:root {
  --bg: #E8EAEB;
  --surface: #F7F8F8;
  --ink: #1A2230;
  --muted: #5F6875;
  --rule: #C9CED3;
  --navy: #2C3E50;       /* matches the app icon */
  --accent: #27AE60;     /* icon green, for bars and lines (not text) */
  --on-navy: #FFFFFF;
  --heavy: #B8322A;
  --light: #2E6DB4;
  --good: #1F7A45;
  --good-bg: #D3EEDC;
  --great: #FFFFFF;
  --great-bg: #1F6B3E;
  --fair: #8A5A00;
  --fair-bg: #FBE8B8;
  --bad: #A3261E;
  --bad-bg: #F8D3CF;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --tabs-h: 3.6rem;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151A20; --surface: #1E252D; --ink: #E7EAED; --muted: #9AA3AD;
    --rule: #333C46; --navy: #8FB3E0; --accent: #3CCB7A; --on-navy: #10161D;
    --heavy: #E8665D; --light: #6FA6E8; --good: #5CC98A;
    --good-bg: #173524; --great: #0E1A12; --great-bg: #5CC98A; --fair: #F2C14E; --fair-bg: #3A2E10; --bad: #F08A80; --bad-bg: #3E1A17;
  }
}
*, *::before, *::after { box-sizing: inherit; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--body); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--light); outline-offset: 2px; }
button { font: inherit; color: inherit; cursor: pointer; }
.page { max-width: 34rem; margin: 0 auto; padding-left: 1.1rem; padding-right: 1.1rem; }
.muted { color: var(--muted); }
.brand { font: 700 1.25rem/1 var(--display); letter-spacing: .02em; color: var(--navy); }
.linkbtn { background: none; border: 0; color: var(--muted); font-size: .9rem; padding: .4rem; }

/* Forms */
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
input, select { width: 100%; font: inherit; padding: .65rem .75rem; border: 1px solid var(--rule); border-radius: 8px;
                background: var(--surface); color: var(--ink); }
input[type="checkbox"], input[type="radio"] { width: auto; }
.primary { font-weight: 600; padding: .75rem 1rem; border: 0; border-radius: 8px; background: var(--navy); color: var(--on-navy); }
.secondary { font-weight: 600; padding: .7rem 1rem; border: 1.5px solid var(--navy); border-radius: 8px; background: none; color: var(--navy); }
.small { padding: .4rem .75rem; font-size: .9rem; }
.textbtn { background: none; border: 0; padding: .3rem 0; color: var(--muted); font-size: .88rem; text-decoration: underline; }
button:disabled { opacity: .55; cursor: default; }
.error { color: var(--heavy); font-size: .9rem; min-height: 1.3em; margin-top: .75rem; }

/* Login */
.login { padding-top: 2rem; }
.login h1 { font: 700 2.6rem/1 var(--display); margin: 2rem 0 .5rem; }
.login p { margin: 0 0 1.5rem; }
.login input { margin-bottom: 1rem; }
.login .primary { width: 100%; }

/* App frame */
.topbar { display: flex; justify-content: space-between; align-items: center; padding-top: 1rem; }
#view { padding-top: 1rem; padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 2rem); }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--surface);
        border-top: 1px solid var(--rule); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabs button { flex: 1; height: var(--tabs-h); background: none; border: 0; font-weight: 600; color: var(--muted);
               border-top: 3px solid transparent; }
.tabs button[aria-current="page"] { color: var(--ink); border-top-color: var(--ink); }

/* Day header */
.daynav { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem; }
.navbtn { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--rule); background: var(--surface);
          font-size: 1.4rem; line-height: 1; }
.day { font: 700 3.2rem/.9 var(--display); margin: 0; }
.sub { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; color: var(--muted); margin: .45rem 0 1.6rem; }
.where { font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--rule);
         padding: .15rem .6rem; border-radius: 999px; font-size: .9rem; }
.where.travel { border-color: var(--light); color: var(--light); }

/* Slots and items */
.slot { border-top: 4px solid var(--ink); padding-top: .6rem; margin-bottom: 2rem; }
.slot h2 { font: 700 1.1rem/1 var(--display); letter-spacing: .04em; margin: 0 0 .4rem; color: var(--muted); }
.item { padding: .8rem 0; border-bottom: 1px solid var(--rule); }
.item:last-child { border-bottom: 0; }
.itemhead { display: grid; grid-template-columns: 1fr auto; gap: .15rem 1rem; align-items: center; }
.name { font-weight: 600; }
.meta { color: var(--muted); font-size: .88rem; }
.weight { grid-row: 1 / span 2; grid-column: 2; font: 700 2rem/1 var(--display); text-align: right; }
.weight small { font-size: .9rem; color: var(--muted); margin-left: .15rem; }
.tag { font-size: .72rem; font-weight: 700; padding: .05rem .45rem; border-radius: 4px; margin-left: .4rem;
       vertical-align: .1rem; border: 1.5px solid currentColor; }
.tag.heavy { color: var(--heavy); }
.tag.light { color: var(--light); }
.tag.optional { color: var(--muted); }
/* Accessory lifts (3 × 8–12, no heavy/light day): quiet, so Heavy and Light stand out */
.tag.accessory { color: var(--muted); }
.tag.done { color: var(--good); }
.tag.waiting { color: var(--fair); background: var(--fair-bg); }

.targets { margin: .4rem 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr auto; gap: .1rem 1rem; font-size: .92rem; }
.targets li { display: contents; }
.targets span:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.logged { list-style: none; margin: .55rem 0 0; padding: 0; font-size: .92rem; }
.logged li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .3rem 0;
             border-top: 1px dashed var(--rule); font-variant-numeric: tabular-nums; }
.logged .x { background: none; border: 0; color: var(--muted); font-size: 1.2rem; line-height: 1; padding: .2rem .4rem; }
/* Warm-up and plates on Today (2.16) */
.warmup { margin: .35rem 0 .2rem; }
.wsteps { list-style: none; margin: .25rem 0 0; padding: 0; font-size: .9rem; }
.wsteps li { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; padding: .25rem 0;
             border-top: 1px dashed var(--rule); font-variant-numeric: tabular-nums; }
.wsteps li span:last-child { text-align: right; }
.eqrow { display: grid; grid-template-columns: 1fr 1fr auto; gap: .4rem; align-items: end; margin-bottom: .35rem; }
.eqrow.bars { grid-template-columns: 1.6fr .8fr 1.4fr auto; }
.actions { display: flex; gap: .6rem; align-items: center; margin-top: .6rem; flex-wrap: wrap; }

/* Inline editor */
.editor { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: .85rem; margin-top: .6rem; }
.editor h3 { margin: 0 0 .6rem; font-size: .95rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .6rem; }
.walkrow { margin-top: .5rem; }
.setrow { display: grid; grid-template-columns: 3.2rem 1fr 1fr; gap: .5rem; align-items: center; margin-bottom: .45rem; }
.setrow .n { color: var(--muted); font-size: .88rem; }
.fieldrow { display: grid; grid-template-columns: 1fr 6.5rem; gap: .75rem; align-items: center; margin-bottom: .45rem; }
.fieldrow input, .setrow input { text-align: center; font-variant-numeric: tabular-nums; }

.summary { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .7rem; }

/* Cards (trips, lifts) */
.pagehead { font: 700 2.4rem/1 var(--display); margin: 0 0 1.2rem; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 1rem; margin-bottom: 1.2rem; }
.panel h2 { margin: 0 0 .75rem; font-size: 1.05rem; }
.panel.current { border: 2px solid var(--light); }
.stack > * + * { margin-top: .7rem; }
.check { display: flex; gap: .5rem; align-items: center; font-size: .95rem; color: var(--ink); margin: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .7rem 0; border-top: 1px solid var(--rule); }
.list li:first-child { border-top: 0; }

.lift { padding: 1rem 0; border-top: 1px solid var(--rule); }
.lift:first-of-type { border-top: 0; }
.lifthead { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.lifthead .weight { font-size: 1.8rem; }
.bar { height: 6px; background: var(--rule); border-radius: 3px; margin: .5rem 0 .3rem; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--navy); }

/* Toast */
#toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 1rem);
         transform: translateX(-50%); max-width: min(30rem, calc(100% - 2rem)); background: var(--ink); color: var(--bg);
         padding: .75rem 1rem; border-radius: 10px; font-size: .95rem; box-shadow: 0 6px 20px rgba(0,0,0,.25);
         opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; }
#toast.bad { background: var(--heavy); color: #fff; }

/* Offline banner */
.offlinebar { margin: .75rem 0 0; padding: .6rem .8rem; border-radius: 8px; background: var(--fair-bg);
              color: var(--fair); font-size: .9rem; font-weight: 600; }
.outboxbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem .8rem; }
.outboxbar .textbtn { color: inherit; text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

/* Profile */
.who { font-size: .9rem; color: var(--muted); margin-right: .25rem; }
.section { font: 700 1.1rem/1 var(--display); letter-spacing: .04em; color: var(--muted); margin: 1.4rem 0 .6rem;
           padding-top: .6rem; border-top: 4px solid var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@media (min-width: 30rem) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: .7rem .8rem; }
.tlabel { font-size: .78rem; font-weight: 600; color: var(--muted); }
.tvalue { font: 700 1.6rem/1.1 var(--display); margin-top: .15rem; }
.tsub { font-size: .8rem; color: var(--muted); margin-top: .1rem; }
/* Levels always pair a color with a word, and differ in brightness as well as hue */
.tile.lv-good { background: var(--good-bg); border-color: var(--good); }
.tile.lv-good .tsub { color: var(--good); font-weight: 700; }
.tile.lv-fair { background: var(--fair-bg); border-color: var(--fair); }
.tile.lv-fair .tsub { color: var(--fair); font-weight: 700; }
.tile.lv-bad  { background: var(--bad-bg); border-color: var(--bad); }
.tile.lv-bad  .tsub { color: var(--bad); font-weight: 700; }
.tabs button { font-size: .95rem; }

/* Nutrition */
.gradecard { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-radius: 12px;
             padding: .9rem 1rem; margin-bottom: .9rem; border: 2px solid var(--rule); background: var(--surface); }
.gradeval { font: 700 3rem/1 var(--display); }
.gradeval small { font-size: 1.1rem; color: inherit; opacity: .7; margin-left: .15rem; }
.gradeword { font-weight: 700; font-size: .95rem; }
.gradecard.lv-great { background: var(--great-bg); border-color: var(--great-bg); color: var(--great); }
.gradecard.lv-great .tlabel, .gradecard.lv-great .check { color: var(--great); }
.gradecard.lv-good { background: var(--good-bg); border-color: var(--good); }
.gradecard.lv-good .gradeword { color: var(--good); }
.gradecard.lv-fair { background: var(--fair-bg); border-color: var(--fair); }
.gradecard.lv-fair .gradeword { color: var(--fair); }
.gradecard.lv-bad { background: var(--bad-bg); border-color: var(--bad); }
.gradecard.lv-bad .gradeword { color: var(--bad); }
.gradecard.lv-none .gradeword { color: var(--muted); }
.donebox { font-weight: 600; white-space: nowrap; }
.donebox input { width: 1.2rem; height: 1.2rem; }

.nhead, .nrow { display: grid; grid-template-columns: 5.2rem 1fr 1fr 3.4rem; gap: .5rem; align-items: center; }
.nhead { font-size: .78rem; color: var(--muted); font-weight: 600; padding: 0 .6rem .25rem; }
.nhead span:not(:first-child), .nrow span:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.nrow { padding: .55rem .6rem; border-radius: 8px; margin-bottom: .35rem; border-left: 5px solid var(--rule); background: var(--surface); }
.nrow.lv-good { border-left-color: var(--good); }
.nrow.lv-fair { border-left-color: var(--fair); background: var(--fair-bg); }
.nrow.lv-bad  { border-left-color: var(--bad); background: var(--bad-bg); }
.nlabel { font-weight: 600; }
.neaten { font-weight: 700; }
.ntarget, .npts { color: var(--muted); font-size: .88rem; }
.actions.water { margin: .2rem 0 1.6rem; }
.mealtime { margin: -.15rem 0 .45rem; }
.mealtot { float: right; font: 600 .82rem var(--body); letter-spacing: 0; color: var(--muted); }
.logged li > span .meta { display: block; }

.foodlist { max-height: 22rem; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
            margin-top: .5rem; border: 1px solid var(--rule); border-radius: 8px; padding: .3rem .5rem; background: var(--bg); }
.foodrow { display: flex; align-items: center; gap: .5rem; border-bottom: 1px solid var(--rule); }
.foodrow:last-child { border-bottom: 0; }
.foodrow .foodopt { flex: 1; border-bottom: 0; }
.foodrow .textbtn { flex: none; padding: .4rem .2rem; }
.foodedit { padding: .4rem 0 .6rem; border-bottom: 1px solid var(--rule); }
.foodedit .editor { margin: 0; }
.listhead { margin: .6rem 0 .1rem; font-weight: 600; }
.listhead:first-child { margin-top: .2rem; }
.foodopt { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; background: none;
           border: 0; border-bottom: 1px solid var(--rule); padding: .55rem .2rem; }
.foodopt:last-child { border-bottom: 0; }
.pending { margin-top: .7rem; }
.pendrow { display: grid; grid-template-columns: 4rem 1fr auto; gap: .5rem; align-items: center; margin-bottom: .35rem; }
.pendrow input { text-align: center; padding: .45rem; }
.pendrow .x { background: none; border: 0; color: var(--muted); font-size: 1.2rem; }

.balance { font-variant-numeric: tabular-nums; }
.balance > div { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; }
.balance .sum { border-top: 1px solid var(--rule); font-weight: 700; }
.tile.lv-none { opacity: .85; }
.tiles.two { grid-template-columns: 1fr; }
@media (min-width: 30rem) { .tiles.two { grid-template-columns: 1fr 1fr; } }
.libedit { display: block !important; }
.tabs button { font-size: .88rem; }
@media (max-width: 24rem) { .tabs button { font-size: .8rem; } }   /* six tabs from 2.7 */
.tile.lv-great { background: var(--great-bg); border-color: var(--great-bg); color: var(--great); }
.tile.lv-great .tlabel, .tile.lv-great .tsub { color: var(--great); font-weight: 700; }

.gradeside { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; }
.gradecard.lv-great .textbtn { color: var(--great); }
.travelnote { border-color: var(--light); font-size: .95rem; }
.movenote { margin: .2rem 0 .8rem; }
.movenote .rowbtns { display: inline-flex; gap: .8rem; margin-left: .3rem; }
.warn { color: var(--fair); font-size: .9rem; }
.dimmed { opacity: .55; }
.nrow.lv-none { border-left-color: var(--rule); }

/* Tables */
.tablewrap { overflow-x: auto; margin: .6rem 0 .3rem; }
.ptable { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.ptable th, .ptable td { padding: .45rem .4rem; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
.ptable thead th { font-size: .78rem; color: var(--muted); font-weight: 600; }
.ptable tbody th { text-align: left; font-weight: 600; }
.ptable tr.strong td, .ptable tr.strong th { font-weight: 700; }
/* TDEE: the total of the two rows above it, with a heavier line on top like a sum */
.ptable tr.subtotal td, .ptable tr.subtotal th { font-weight: 700; border-top: 2px solid var(--muted); }
/* Coffee note under the coffee buttons (cups after your "No coffee after" time) */
.coffeenote { margin: -1.2rem 0 1.4rem; font-size: .85rem; }
.ptable .total { font-weight: 700; background: var(--surface); }
.lvtext-good { color: var(--good); }
.lvtext-fair { color: var(--fair); }
.lvtext-bad  { color: var(--bad); }

.weighrow { display: grid; grid-template-columns: auto 4.6rem auto auto 4.2rem auto 1fr; gap: .45rem; align-items: center;
            background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: .6rem .75rem; margin-bottom: 1.4rem; }
.weighrow label { margin: 0; font-weight: 600; color: var(--ink); font-size: .95rem; white-space: nowrap; }
.weighrow input { text-align: center; padding: .45rem; }
.weighrow button { justify-self: end; }
/* Narrow phones: weight and body fat on the first line, the button under them */
@media (max-width: 430px) {
  .weighrow { grid-template-columns: auto 4.4rem auto auto 4rem auto; }
  .weighrow button { grid-column: 1 / 3; justify-self: start; }
}

/* Wide screens: laptop and desktop */
@media (min-width: 60rem) {
  .page { max-width: 68rem; padding-left: 2rem; padding-right: 2rem; }
  #app { padding-top: var(--tabs-h); }
  .tabs { top: 0; bottom: auto; border-top: 0; border-bottom: 1px solid var(--rule); justify-content: center; padding-bottom: 0; z-index: 5; }
  .tabs button { flex: 0 1 9rem; border-top: 0; border-bottom: 3px solid transparent; font-size: .95rem; }
  .tabs button[aria-current="page"] { border-bottom-color: var(--ink); }
  #view { padding-bottom: 3rem; }
  #toast { bottom: 1.5rem; }
  .twocol { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
  .slots { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .tiles.two { grid-template-columns: 1fr 1fr; }
  .login { max-width: 26rem; }
}

#forgot-btn { margin-top: .4rem; }

/* Plan */
.seg { display: flex; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 3px; margin-bottom: 1rem; }
.seg button { flex: 1; border: 0; background: none; padding: .55rem .4rem; border-radius: 8px; font-weight: 600; color: var(--muted); font-size: .92rem; }
.seg button[aria-pressed="true"] { background: var(--navy); color: var(--on-navy); }
.seg.small button { padding: .4rem; font-size: .88rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--rule); background: var(--surface);
        border-radius: 999px; padding: .35rem .7rem; font-weight: 600; font-size: .9rem; margin: 0; color: var(--ink); }
.chip small { font-weight: 700; color: var(--muted); font-size: .72rem; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"] small { color: var(--bg); opacity: .75; }
.slot.plain { margin-bottom: 1.4rem; }
.planlist { list-style: none; margin: 0; padding: 0; }
.planrow { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--rule); }
.rowbtns { display: flex; align-items: center; gap: .15rem; flex-shrink: 0; }
.iconbtn { width: 2rem; height: 2rem; border-radius: 6px; border: 1px solid var(--rule); background: var(--surface); line-height: 1; }
.planrow .x { background: none; border: 0; color: var(--muted); font-size: 1.25rem; padding: .2rem .45rem; }
.circrow { display: grid; grid-template-columns: 1fr 7rem; gap: .6rem; align-items: center; margin-bottom: .35rem; }
.circrow input[data-pe-max] { text-align: center; padding: .45rem; }
.presets li.current { background: var(--surface); margin: 0 -.5rem; padding-left: .5rem; padding-right: .5rem; border-radius: 8px; }

/* Progress chart */
.chartcard { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: .9rem; }
.charthead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .6rem; margin-bottom: .4rem; }
.charthead .seg { margin: 0; }
.charthead .seg button { padding: .3rem .6rem; }
.stats { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-variant-numeric: tabular-nums; }
.stats strong { font: 700 1.25rem/1.1 var(--display); }
.chart { width: 100%; height: auto; display: block; }
.chart .gl { stroke: var(--rule); stroke-width: 1; }
.chart .ax { fill: var(--muted); font: 11px var(--body); }
.chart .avg { fill: none; stroke: var(--navy); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--muted); opacity: .75; }
.chart .tgt { stroke: var(--good); stroke-width: 1.5; stroke-dasharray: 6 5; }
.chart .tgtlabel { fill: var(--good); font: 700 11px var(--body); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.legend i { display: inline-block; vertical-align: middle; margin-right: .35rem; }
.k-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--muted); }
.k-avg { width: 1rem; height: 3px; background: var(--navy); }
.k-tgt { width: 1rem; border-top: 2px dashed var(--good); }
/* Lifting progress chart on Goals (2.21) */
.chart .dot.open { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; opacity: 1; }
.k-dot.open { background: transparent; border: 1.5px solid var(--muted); box-sizing: border-box; }
.liftpick { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.liftpick select { flex: 1 1 10rem; width: auto; margin: 0; }
.liftpick .seg { margin: 0; }
.liftpick .seg button { padding: .3rem .6rem; white-space: nowrap; }
.lvhead .liftname { padding: 0; font: inherit; font-weight: inherit; color: inherit; text-align: left; text-decoration: underline dotted; text-underline-offset: 3px; }

/* Deload */
.panel.deload { border: 2px solid var(--light); font-size: .95rem; }
.panel.deload.soft { border-width: 1px; }
.panel.deload.due { border-color: var(--fair); background: var(--fair-bg); }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: .45rem; }
.logo { width: 1.7rem; height: 1.7rem; border-radius: 7px; display: block; }
.login .logo { width: 2.2rem; height: 2.2rem; border-radius: 9px; }
.bar span { background: var(--accent); }
.chart .tgt { stroke: var(--accent); }
.chart .tgtlabel { fill: var(--good); }
.k-tgt { border-top-color: var(--accent); }

/* Circuit grid */
table.grid { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.grid th { font-size: .78rem; color: var(--muted); font-weight: 600; padding: .25rem; text-align: center; white-space: nowrap; }
table.grid tbody th { font-size: .9rem; color: var(--ink); }
table.grid td { padding: .2rem; }
table.grid td input { width: 100%; min-width: 3.2rem; text-align: center; padding: .45rem .2rem; }
table.grid td.na { text-align: center; color: var(--muted); }
.logged .rowbtns .textbtn { margin-right: .2rem; }

/* Grade while in progress: colored outline and label, fill only when finished */
.gradecard.soft { background: var(--surface) !important; color: var(--ink) !important; border-width: 3px; }
.gradecard.soft.lv-great { border-color: var(--great-bg); }
.gradecard.soft.lv-great .gradeword, .gradecard.soft.lv-great .tlabel, .gradecard.soft.lv-great .check, .gradecard.soft.lv-great .textbtn { color: var(--good); }
.gradecard.soft .tlabel { color: var(--muted); }
.gradecard.soft .check { color: var(--ink); }
.gradecard.soft .textbtn { color: var(--muted); }
.nrow.soft { background: var(--surface) !important; }

/* Why this score */
.reasons { list-style: none; margin: -.4rem 0 1rem; padding: 0; font-size: .92rem; }
.reasons li { display: flex; justify-content: space-between; gap: .75rem; padding: .45rem .6rem; border-left: 4px solid var(--rule);
              background: var(--surface); border-radius: 0 6px 6px 0; margin-bottom: .3rem; }
.reasons li.lv-fair { border-left-color: var(--fair); }
.reasons li.lv-bad { border-left-color: var(--bad); }
.reasons .pts { font-weight: 700; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.reasons-ok { margin: -.4rem 0 1rem; font-weight: 600; color: var(--good); }

/* Goals */
.goal { margin: .7rem 0 1rem; }
.goalhead, .goalfoot { display: flex; justify-content: space-between; gap: 1rem; }
.goalhead .lvtext-good { font-weight: 700; }
.bar.big { height: 10px; border-radius: 5px; margin: .35rem 0 .25rem; }
.goalfoot { font-size: .82rem; }

/* Polish */
.extra-only { margin: -.8rem 0 1.4rem; }
details.totalswrap > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: .75rem; }
details.totalswrap > summary::-webkit-details-marker { display: none; }
details.totalswrap > summary h2 { margin: 0; }
details.totalswrap > summary::after { content: "Show"; margin-left: auto; font-size: .88rem; color: var(--navy); font-weight: 600; text-decoration: underline; }
details.totalswrap[open] > summary::after { content: "Hide"; }
.version { text-align: center; margin: 1.5rem 0 0; }

.goallinks { margin-top: .4rem; }

/* Photo logging */
.editor.photo .seg { margin-bottom: .7rem; }
.photodrop { position: relative; display: flex; align-items: center; justify-content: center; min-height: 8rem; margin: 0 0 .7rem;
             border: 2px dashed var(--rule); border-radius: 10px; background: var(--bg); color: var(--muted); text-align: center;
             padding: .8rem; cursor: pointer; overflow: hidden; }
.pastebox { min-height: 2.6rem; margin: 0; padding: .6rem .75rem; border: 1px solid var(--rule); border-radius: 8px;
            background: var(--surface); color: var(--muted); font-size: .9rem; caret-color: transparent; -webkit-user-select: text; user-select: text; }
.pastebox:empty::before { content: 'Or press and hold here, then tap Paste'; }
.photodrop img { max-width: 100%; max-height: 14rem; border-radius: 6px; display: block; }
.photodrop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
textarea { width: 100%; font: inherit; padding: .6rem .75rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); color: var(--ink); resize: vertical; }
.photoresult { display: grid; grid-template-columns: 5.5rem 1fr; gap: .8rem; align-items: start; }
.photoresult img { width: 100%; border-radius: 8px; }
.photoresult .items { list-style: none; margin: .4rem 0 0; padding: 0; font-size: .9rem; }
.photoresult .items li { display: flex; justify-content: space-between; gap: .6rem; padding: .2rem 0; border-bottom: 1px dashed var(--rule); }
.perserving { margin-top: .3rem; font-size: .92rem; }
.labeltotal { font-weight: 700; margin: .6rem 0; }

/* Strength levels */
.strength .lvtop { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; }
.strength select { width: auto; padding: .35rem .5rem; }
label.inline { display: inline; margin: 0; }
.lvlegend { display: grid; grid-template-columns: repeat(5, 1fr); text-align: center; font-size: .72rem; margin-bottom: -.3rem; }
.lvrow { padding: .5rem 0 .2rem; border-top: 1px solid var(--rule); }
.lvhead, .lvfoot { display: flex; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.lvfoot { font-size: .8rem; }
.lvbar { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; margin: .45rem 0 1.4rem; }
.lvbar span, .lvbar button { height: 12px; padding: 0; border: 0; background: var(--rule); border-radius: 3px; position: relative; }
.lvbar .on { background: var(--accent); }
.lvbar .lvgoal { outline: 2px solid var(--navy); outline-offset: 1px; }
/* 2.7: each level's weight sits at the left edge of its part (where that level starts) */
.lvbar em { position: absolute; top: 14px; left: 0; text-align: left; font-style: normal; font-size: .7rem; color: var(--muted); }
.lvbar .lvgoal em { color: var(--navy); font-weight: 700; }
/* Goals tab: tap a level on a lift's bar to aim at it. A taller invisible area makes it easy to hit. */
.lvbar button { cursor: pointer; }
.lvbar button::after { content: ''; position: absolute; left: 0; right: 0; top: -10px; bottom: -18px; }
.liftgoal { display: inline-flex; align-items: center; gap: .45rem; }
.liftgoal .step { width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--rule); background: var(--surface);
  font-size: 1.15rem; font-weight: 700; line-height: 1; color: var(--ink); }
.liftgoal .step:disabled { opacity: .3; }
.lvown { margin-top: .25rem; }
.lvfoot { align-items: center; }
.lvbar i { position: absolute; top: -4px; width: 4px; height: 20px; margin-left: -2px; background: var(--ink); border-radius: 2px; }
.lvfoot { margin-top: 1rem; }
.strength .seg button { padding: .5rem .2rem; font-size: .85rem; }

/* Form guides */
.howto { margin-left: .4rem; font-size: .85rem; }
.howtos { margin-top: .2rem; }
.howtos .howto { margin-left: 0; margin-right: .5rem; }
#form-dialog { border: 0; border-radius: 14px; padding: 0; width: min(36rem, calc(100vw - 1.5rem)); max-height: calc(100vh - 2rem);
               background: var(--bg); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
#form-dialog::backdrop { background: rgba(15, 20, 28, .55); }
.formguide { padding: 1rem 1.1rem 1.3rem; }
.fghead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.fghead h2 { font: 700 1.9rem/1 var(--display); margin: 0; }
.fghead .x { background: none; border: 0; font-size: 1.8rem; color: var(--muted); padding: .2rem .5rem; }
.formguide h3 { font-size: .95rem; margin: 1.1rem 0 .45rem; }
.cues { margin: 0; padding-left: 1.2rem; }
.cues li { margin-bottom: .4rem; line-height: 1.4; }
.video { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; margin-bottom: .6rem; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.fgrow { display: grid; grid-template-columns: 1fr auto; gap: .5rem; margin: .6rem 0 .2rem; }
a.linkbtn2 { display: inline-block; text-decoration: none; }
.mymedia img, .mymedia video { width: 100%; border-radius: 10px; display: block; background: #000; }
.filebtn { position: relative; display: inline-block; overflow: hidden; margin-top: .3rem; cursor: pointer; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Muscle maps: primary darker, secondary lighter, always with a written list */
:root { --mm-body: #DFE3E7; --mm-idle: #C3C9D0; --mm-pri: #B03A2E; --mm-sec: #F2A39A; --mm-line: #F7F8F8; }
@media (prefers-color-scheme: dark) {
  :root { --mm-body: #2A323B; --mm-idle: #3D4752; --mm-pri: #E8665D; --mm-sec: #7E4540; --mm-line: #151A20; }
}
.musclemap { width: 100%; max-width: 22rem; display: block; margin: 0 auto; }
.musclemap .mm-body * { fill: var(--mm-body); }
.musclemap .mm-m { fill: var(--mm-idle); stroke: var(--mm-line); stroke-width: 1; }
.musclemap .mm-m.pri { fill: var(--mm-pri); }
.musclemap .mm-m.sec { fill: var(--mm-sec); }
.musclemap .mm-label { font: 600 11px var(--body); fill: var(--muted); }
.mmlegend { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; margin-top: .4rem; }
.mmlegend i { display: inline-block; width: .85rem; height: .85rem; border-radius: 3px; margin-right: .4rem; vertical-align: -.1rem; }
.mmlegend i.pri { background: var(--mm-pri); }
.mmlegend i.sec { background: var(--mm-sec); }

/* Combined muscle views: list by muscle, and the weekly shading (light = helping only, dark = 3+ days) */
:root { --mm-h1: #F6D3CE; --mm-h2: #EE9C91; --mm-h3: #D0604F; --mm-h4: #962A1F; }
@media (prefers-color-scheme: dark) {
  :root { --mm-h1: #4A2D2A; --mm-h2: #7E4239; --mm-h3: #B9584C; --mm-h4: #F08A80; }
}
.musclemap .mm-m.h1 { fill: var(--mm-h1); }
.musclemap .mm-m.h2 { fill: var(--mm-h2); }
.musclemap .mm-m.h3 { fill: var(--mm-h3); }
.musclemap .mm-m.h4 { fill: var(--mm-h4); }
.mmlegend i.h1, .mmdot.h1 { background: var(--mm-h1); }
.mmlegend i.h2, .mmdot.h2 { background: var(--mm-h2); }
.mmlegend i.h3, .mmdot.h3 { background: var(--mm-h3); }
.mmlegend i.h4, .mmdot.h4 { background: var(--mm-h4); }
.mmlegend.heat { flex-direction: row; flex-wrap: wrap; gap: .3rem 1rem; font-size: .85rem; }
.mmlist { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.mmlist li { display: flex; gap: .5rem; align-items: baseline; padding: .35rem 0; border-top: 1px solid var(--rule); }
.mmlist li:first-child { border-top: 0; }
.mmlist li > i { flex: none; width: .85rem; height: .85rem; border-radius: 3px; transform: translateY(.1rem); }
.mmlist li > i.pri { background: var(--mm-pri); }
.mmlist li > i.sec { background: var(--mm-sec); }
.mmlist .meta { display: block; }
.mmweek th, .mmweek td { text-align: left; white-space: normal; }
.mmdot { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-right: .4rem; vertical-align: -.05rem; }

/* Stall reset suggestion */
.panel.stall { border: 2px solid var(--fair); background: var(--fair-bg); font-size: .93rem; margin: .6rem 0 0; }

/* Totals: All exercise (time and calories for every workout together) */
.alltotals { margin: .9rem 0 .4rem; padding: .9rem 1rem 1rem; border-radius: 12px; background: var(--navy); color: var(--on-navy);
             border-top: 5px solid var(--accent); }
.alltitle { margin: 0 0 .6rem; font: 700 1.1rem/1 var(--display); letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.allgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem 1rem; }
.allcell { display: flex; flex-direction: column; min-width: 0; }
.allperiod { font-size: .78rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; opacity: .75; }
.allbig { font: 700 2.4rem/1.05 var(--display); white-space: nowrap; }
.allcal { font: 700 1.5rem/1.1 var(--display); color: var(--accent); white-space: nowrap; }
.allbig small, .allcal small { font-size: .55em; font-weight: 600; opacity: .8; }
.allcal small { color: var(--on-navy); }
@media (max-width: 560px) {
  .allgrid { grid-template-columns: repeat(2, 1fr); }
  .allbig { font-size: 2.2rem; }
}
@media (prefers-color-scheme: dark) {
  /* Deep navy card in dark mode too, so the green calories stay easy to read */
  .alltotals { background: #1B2B3C; color: #F2F5F7; }
  .allcal small { color: #F2F5F7; }
}

/* Totals: one card per activity, in the same style as All exercise.
   Each card has its own accent color, the big condensed numbers, the Year column (your running
   total) a little stronger, and time and calories in a dark band along the bottom. */
:root {
  --lift: #C8681C;
  --band: #2C3E50; --band-ink: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  :root { --lift: #F0A04B; --band: #1B2B3C; --band-ink: #F2F5F7; }
}
.totalsgrid { margin-top: 1rem; }
.tstack { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.totalsgrid > .tstack + .tstack { margin-top: 1rem; }
@media (min-width: 60rem) {
  .totalsgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
  .totalsgrid > .tstack + .tstack { margin-top: 0; }
}

.tcard { --tc: var(--accent); background: var(--surface); border: 1px solid var(--rule); border-top: 5px solid var(--tc);
         border-radius: 12px; overflow: hidden; box-shadow: 0 1px 2px rgba(20, 30, 45, .05), 0 4px 14px rgba(20, 30, 45, .05); }
.tcard.walk { --tc: var(--light); }
.tcard.weights { --tc: var(--lift); }
.tchead { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; padding: .8rem 1rem .3rem; }
.tchead h3 { margin: 0; font: 700 1.2rem/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--tc); }
.tcsub { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tcard .tablewrap { margin: 0; }

.ttable { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ttable th, .ttable td { padding: .5rem .55rem; text-align: right; white-space: nowrap; vertical-align: middle; border: 0; }
.ttable th:first-child { padding-left: 1rem; text-align: left; }
.ttable th:last-child, .ttable td:last-child { padding-right: 1rem; }
.ttable thead th { padding-top: .15rem; padding-bottom: .4rem; font-size: .68rem; font-weight: 700; letter-spacing: .08em;
                   text-transform: uppercase; color: var(--muted); }
.ttable thead th:last-child { color: var(--ink); }
.ttable tbody th { font-size: .92rem; font-weight: 600; }
.ttable tbody tr:nth-child(odd) { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.ttable td { font: 600 1.25rem/1.1 var(--display); color: color-mix(in srgb, var(--ink) 78%, var(--surface)); }
.ttable td:last-child { font-weight: 700; color: var(--ink); }
.ttable td small { margin-left: .04em; font-size: .62em; font-weight: 600; color: var(--muted); }
.ttable td.zero { color: color-mix(in srgb, var(--muted) 45%, var(--surface)); font-weight: 600; }

/* Weight training: the heaviest weight sits under the average, only when it's higher */
.ttable .top { display: block; margin-top: .1rem; font: 700 .7rem/1.1 var(--body); letter-spacing: .02em; color: var(--tc); }
/* Year by year: the change against last year sits under this year's pace */
.yearcard { margin-top: 1rem; }
.ttable .chg { display: block; margin-top: .1rem; font: 700 .7rem/1.1 var(--body); letter-spacing: .02em; }
.ttable .chg.up { color: var(--good); }
.ttable .chg.down { color: var(--bad); }
.ttable .lightonly { font: 600 .78rem var(--body); color: var(--muted); }

/* The dark band: time and calories */
.ttable tfoot tr { background: var(--band); color: var(--band-ink); }
.ttable tfoot th { font-size: .82rem; font-weight: 600; letter-spacing: .02em; opacity: .8; }
.ttable tfoot td, .ttable tfoot td:last-child { color: var(--band-ink); }
.ttable tfoot td small { color: inherit; opacity: .7; }
.ttable tfoot tr.cal td, .ttable tfoot tr.cal td:last-child { color: var(--accent); }
.ttable tfoot tr.cal td small { color: var(--band-ink); }
.ttable tfoot tr td.zero { color: color-mix(in srgb, var(--band-ink) 30%, var(--band)); }
.ttable tfoot tr:first-child > * { padding-top: .75rem; }
.ttable tfoot tr:last-child > * { padding-bottom: .8rem; }

.tcnote { margin: -.4rem .2rem 0; font-size: .78rem; font-style: italic; line-height: 1.4; color: var(--muted); }

.ttable tbody th small { font-size: .75em; font-weight: 600; color: var(--muted); }

/* Phones: tighter so all four columns fit without scrolling */
@media (max-width: 560px) {
  .tchead { padding-left: .75rem; padding-right: .75rem; }
  .ttable th, .ttable td { padding-left: .2rem; padding-right: .2rem; }
  .ttable th:first-child { padding-left: .75rem; }
  .ttable th:last-child, .ttable td:last-child { padding-right: .75rem; }
  .ttable tbody th, .ttable tfoot th { font-size: .8rem; white-space: normal; }
  .ttable td { font-size: 1.02rem; }
  .ttable td small { font-size: .58em; }
  .ttable thead th { font-size: .62rem; letter-spacing: .05em; }
}

/* Calorie balance on Food (2.4), in the Totals style: the dark band, then Energy, Macros and Limits cards */
.tcard.energy { --tc: var(--lift); }
.tcard.macros { --tc: var(--accent); }
.tcard.limits { --tc: var(--light); }
.ptstack { margin-top: 1rem; }
.caltotals .allcal { color: inherit; opacity: .8; font-size: 1.2rem; }
.ptstack + .tcnote { margin: .7rem .2rem 0; }
.allfoot { margin: .6rem 0 0; font-size: .74rem; opacity: .7; }
/* Colors that read on the dark band */
:root { --band-good: #5CC98A; --band-fair: #F2C14E; --band-bad: #F08A80; }
.bandlv-good { color: var(--band-good) !important; }
.bandlv-fair { color: var(--band-fair) !important; }
.bandlv-bad  { color: var(--band-bad) !important; }
/* Green, amber and red on the light rows win over the Year column's darker ink */
.ttable td.lvtext-good { color: var(--good); }
.ttable td.lvtext-fair { color: var(--fair); }
.ttable td.lvtext-bad  { color: var(--bad); }
/* TDEE: a line above it, as the sum of the two rows before it */
.ttable tr.subtotal > * { border-top: 2px solid color-mix(in srgb, var(--ink) 35%, transparent); }
.ttable tr.subtotal td { color: var(--ink); }
.ttable tbody th small { font-size: .78em; }
.ttable td .top { color: var(--muted); }
.ttable tfoot td .top { color: var(--band-ink); opacity: .7; }
@media (max-width: 560px) { .caltotals .allbig { font-size: 1.7rem; } }

/* Should I eat this? */
.eatcheck { margin-top: .7rem; display: flex; flex-direction: column; gap: .6rem; }
.eatcard { border: 1.5px solid var(--rule); border-radius: 10px; padding: .75rem .85rem; background: var(--bg); }
.eatcard p { margin: .3rem 0 0; }
.eatcard.lv-good { background: var(--good-bg); border-color: var(--good); }
.eatcard.lv-fair { background: var(--fair-bg); border-color: var(--fair); }
.eatcard.lv-bad  { background: var(--bad-bg); border-color: var(--bad); }
.eatverdict { font: 700 1.5rem/1 var(--display); }
.eatcard.lv-good .eatverdict { color: var(--good); }
.eatcard.lv-fair .eatverdict { color: var(--fair); }
.eatcard.lv-bad  .eatverdict { color: var(--bad); }
.eatflags { margin: .5rem 0 0; padding-left: 1.1rem; }
.eatflags li + li { margin-top: .35rem; }
.eatgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.eatcol { border: 1px solid var(--rule); border-radius: 10px; padding: .6rem .7rem; display: flex; flex-direction: column; gap: .45rem; }
.eathead { font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.eatval { font-weight: 700; }
.eatline .meta { font-size: .8rem; }
.eatcoach { border: 1px solid var(--rule); border-radius: 10px; padding: .6rem .8rem; }
.eatcoach ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.eatcoach li + li { margin-top: .3rem; }
.weekcounts { margin: .8rem 0 .2rem; }
.weekcounts .tvalue .meta { font: 400 .9rem var(--body); }

/* Coach note under a lift in the lifting summary and history */
.coachnote { display: inline-block; margin-top: .2rem; font-size: .88rem; color: var(--ink); }

/* Merge duplicate foods (v59) */
.dupbox .list li { align-items: flex-start; }
.dupbtns { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; flex: none; }
.mergebox .list li { align-items: flex-start; }
.mergepick { align-items: flex-start; flex: 1; }
.mergepick input { margin-top: .25rem; }
.mergebox select { margin-bottom: .2rem; }

/* Check a product (v60) */
.storecheck { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin: 0 0 1rem; }
.prodslots { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .7rem; }
.prodslot { min-height: 7.5rem; margin: 0; padding: .4rem; text-align: center; font-size: .85rem; }
.prodslot img { max-height: 9rem; }
.verdictcard { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-radius: 12px; padding: 1rem 1.1rem; margin: .4rem 0 1rem;
  background: var(--surface); border: 1px solid var(--rule); }
.verdictcard.lv-great { background: var(--great-bg); color: var(--great); border-color: var(--great-bg); }
.verdictcard.lv-good { background: var(--good-bg); color: var(--good); border-color: var(--good-bg); }
.verdictcard.lv-fair { background: var(--fair-bg); color: var(--fair); border-color: var(--fair-bg); }
.verdictcard.lv-bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-bg); }
.verdictcard .tlabel { text-transform: capitalize; }
.verdictcard .gradeval, .verdictcard .gradeword, .verdictcard .tlabel { color: inherit; }
.prodthumbs { display: flex; gap: .35rem; flex: none; }
.prodthumbs img { width: 3.2rem; height: 4.2rem; object-fit: cover; border-radius: 6px; }
.prodname { margin: 0 0 .2rem; font-size: 1.15rem; }
.prodhead { margin: 0 0 1rem; font-size: 1.02rem; }
.prodfacts { padding: .75rem 1rem; }
.prodfacts .perserving { margin: .15rem 0; font-weight: 600; }
.prodlist { margin: 0 0 1rem; padding-left: 1.2rem; }
.prodlist li { margin: .25rem 0; }
.prodlist.pros li::marker { color: var(--good); }
.prodlist.cons li::marker { color: var(--heavy); }
.prodresult h3 { font-size: .98rem; margin: 1rem 0 .3rem; }
.prodresult p { margin: 0 0 .6rem; }
.prodresult a { color: inherit; }

/* Fasting days (v68): coaching panel on the Food tab and the note when food was logged anyway */
.panel.fastcoach { border-left: 5px solid var(--good); margin-bottom: 1rem; }
.panel.fastcoach ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.panel.fastcoach li { margin: .25rem 0; }
.fastnote { margin: -.4rem 0 .9rem; }

/* Weekly recaps (2.8): Today card, pop-up, and the Coaching section on Goals & Coaching */
.recapcard { border: 2px solid var(--accent); border-left-width: 6px; }
.recapcard.read { border-width: 1px; border-left-width: 6px; border-color: var(--rule); border-left-color: var(--accent); }
.recapcardhead { font: 700 1.35rem/1.15 var(--display); margin-top: .2rem; }
#recap-dialog { border: 0; border-radius: 14px; padding: 0; width: min(28rem, calc(100vw - 1.5rem));
  background: var(--bg); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
#recap-dialog::backdrop { background: rgba(15, 20, 28, .55); }
.recappop { padding: 1.2rem 1.2rem 1rem; border-top: 6px solid var(--accent); }
.recappop h2 { font: 700 1.8rem/1.1 var(--display); margin: .3rem 0 .6rem; }
details.recap { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; margin-bottom: .8rem; }
details.recap[open] { border-top: 5px solid var(--accent); }
details.recap > summary { list-style: none; cursor: pointer; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .15rem; }
details.recap > summary::-webkit-details-marker { display: none; }
details.recap > summary::after { content: "Open"; align-self: flex-end; margin-top: -1.2rem; font-size: .82rem; color: var(--navy); font-weight: 600; text-decoration: underline; }
details.recap[open] > summary::after { content: "Close"; }
.recapsum { font: 700 1.25rem/1.15 var(--display); padding-right: 3rem; }
.recapbody { padding: 0 1rem 1rem; }
.recapsummary { margin: 0 0 .8rem; }
.recapwins { margin: .3rem 0 0; padding-left: 1.2rem; }
.recapwins li { margin: .25rem 0; }
.recapwins li::marker { content: "✓  "; color: var(--good); font-weight: 700; }
.recapday { border-left: 4px solid var(--fair); background: var(--bg); border-radius: 0 8px 8px 0; padding: .55rem .75rem; margin: .5rem 0; }
.recapday p { margin: .25rem 0 0; font-size: .93rem; }
.recapday .nexttime span { font-weight: 700; color: var(--good); }
.recapnext { margin: .3rem 0 0; padding-left: 1.3rem; }
.recapnext li { margin: .4rem 0; }
.recapnext strong { display: block; }
.recapfocus { margin: .9rem 0 0; padding: .6rem .8rem; border-radius: 8px; background: var(--navy); color: var(--on-navy); }
.recapfoot { margin: .8rem 0 0; }

/* Exercise library switches (2.13): Plan → Lifts and Plan → Circuit */
.libhead { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: .6rem 0 0; }
.list.lib li.librow { padding: .55rem 0; }
.list.lib li.libsuggest { border-top: 0; padding-top: 0; }
.toggle { flex: none; position: relative; width: 3.4rem; height: 1.9rem; border-radius: 1rem; border: 1px solid var(--rule);
  background: var(--rule); color: var(--muted); font-size: .7rem; font-weight: 600; padding: 0 .45rem; cursor: pointer;
  display: flex; align-items: center; justify-content: flex-end; transition: background .15s; }
.toggle::before { content: ''; position: absolute; left: .2rem; top: .2rem; width: 1.45rem; height: 1.45rem; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.toggle[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--on-navy); justify-content: flex-start; }
.toggle[aria-pressed="true"]::before { left: calc(100% - 1.65rem); }
abbr { text-decoration: none; }

/* Meal coaching (2.14): what to aim for at meals still to come, and how logged meals compared */
.mealcoach { margin: -.15rem 0 .45rem; }
.mealcoach.aim { background: var(--surface); border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0; padding: .5rem .7rem; font-size: .93rem; }
.mealcoach .muted { font-weight: 400; }

/* Lighter than planned: new baseline? (2.18) */
.panel.baseline { border: 2px solid var(--light); font-size: .93rem; margin: .6rem 0 0; }

/* Default rounds on Plan → Circuit (2.19): name, then a row of round buttons, then any days that differ */
.list.lib li.roundrow { flex-direction: column; align-items: stretch; gap: .45rem; }
.roundrow .chip { min-width: 2.4rem; justify-content: center; }
.list.roundown li { padding: .3rem 0; border-top: 0; }

/* Rest timer (2.23): a bar above the tabs while you rest between sets or rounds */
.restbar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px)); z-index: 6;
  background: var(--navy); color: var(--on-navy); padding: .55rem 1.1rem .5rem; box-shadow: 0 -4px 16px rgba(0,0,0,.18); }
.restbar.done { background: var(--great-bg); color: var(--great); }
.restrow { max-width: 34rem; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.restlabel { font-size: .78rem; font-weight: 600; letter-spacing: .03em; opacity: .85; }
.resttime { font: 700 2.3rem/1 var(--display); font-variant-numeric: tabular-nums; }
.restbtns { display: flex; align-items: center; gap: .45rem; }
.restbar .step { min-width: 3rem; height: 2.4rem; border-radius: 999px; border: 1.5px solid currentColor; background: none;
  color: inherit; font-weight: 700; font-size: .9rem; }
.restbar .textbtn { color: inherit; opacity: .85; font-size: .95rem; padding: .4rem .2rem; }
.restbar .primary { background: var(--great); color: var(--great-bg); }
.restprog { max-width: 34rem; margin: .45rem auto 0; height: 4px; border-radius: 2px; background: rgba(255,255,255,.22); overflow: hidden; }
.restprog span { display: block; height: 100%; background: var(--accent); transition: width .25s linear; }
body.resting #view { padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 7rem); }
body.resting #toast { bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 6rem); }
@media (min-width: 60rem) { .restbar { bottom: 0; } body.resting #toast { bottom: 6.5rem; } }
@media (prefers-reduced-motion: reduce) { .restprog span { transition: none; } }
/* Lifting sets you can tick off to start a rest */
.setrow.tickable { grid-template-columns: 3.2rem 1fr 1fr 2.6rem; }
.setdonebtn { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1.5px solid var(--rule); background: var(--surface);
  color: var(--muted); font-size: 1.1rem; font-weight: 700; line-height: 1; }
.setdonebtn[aria-pressed="true"] { background: var(--good); border-color: var(--good); color: #fff; }
.setrow.setdone input { color: var(--muted); }
/* Rest timer settings on Profile */
.restset { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .55rem 0; border-top: 1px solid var(--rule); }
.restset:first-of-type { border-top: 0; }
.restset .liftgoal strong { min-width: 3.2rem; text-align: center; display: inline-block; font: 700 1.3rem/1 var(--display); }

/* Personal records (2.24) */
.tag.pr { color: var(--lift); margin-left: 0; margin-right: .3rem; }
.prnote { font-size: .9rem; font-weight: 600; color: var(--lift); }

/* Recovery check-in on Today (2.25) */
.panel.recovery { border-left: 5px solid var(--light); }
.panel.recovery.compact { padding: .65rem 1rem; }
.rechead, .recline { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; }
.recq { margin-top: .6rem; }
.recq .seg { margin: .25rem 0 0; }
.recq .seg button { font-size: .8rem; padding: .45rem .15rem; line-height: 1.15; }
.rechr { display: grid; grid-template-columns: 1fr 6rem; gap: .6rem; align-items: center; margin-top: .7rem; }
.rechr label { margin: 0; }
.rechr input { text-align: center; padding: .45rem; }
.recnote { margin: .6rem 0 0; font-size: .92rem; padding: .45rem .6rem; border-radius: 6px; background: var(--good-bg); color: var(--ink); }
.recnote.lv-fair { background: var(--fair-bg); }

/* ----- Lifting clubs (2.28) ----- */
.clubbadge { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; flex: none;
  border-radius: 50%; background: var(--navy); color: var(--on-navy); box-shadow: 0 0 0 4px var(--accent) inset, 0 0 0 1px var(--accent);
  font-family: var(--display); line-height: 1; text-align: center; }
.clubbadge strong { font-weight: 700; }
.clubbadge em { font-style: normal; font-weight: 600; text-transform: uppercase; color: var(--accent); letter-spacing: .02em; }
.clubbadge.lg { width: 6.2rem; height: 6.2rem; } .clubbadge.lg strong { font-size: 2.1rem; } .clubbadge.lg em { font-size: .8rem; margin-top: .15rem; }
.clubbadge.md { width: 4.4rem; height: 4.4rem; } .clubbadge.md strong { font-size: 1.5rem; } .clubbadge.md em { font-size: .62rem; }
.clubbadge.sm { width: 3.3rem; height: 3.3rem; box-shadow: 0 0 0 3px var(--accent) inset; } .clubbadge.sm strong { font-size: 1rem; } .clubbadge.sm em { font-size: .44rem; letter-spacing: 0; }
.clubbadge.locked { background: var(--bg); color: var(--muted); box-shadow: 0 0 0 2px var(--rule) inset; opacity: .75; }
.clubbadge.locked em { color: var(--muted); }
.clubtop { display: flex; align-items: center; gap: 1rem; }
.clubname { font: 700 1.7rem/1.1 var(--display); }
.clublifts { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.clublift { display: flex; flex-direction: column; background: var(--bg); border-radius: 8px; padding: .45rem .5rem; }
.clublift strong { font: 700 1.5rem/1.1 var(--display); }
.clublift.total { background: var(--navy); color: var(--on-navy); }
.clublift.total .tlabel, .clublift.total .meta { color: rgba(255,255,255,.75); }
.clubbar { height: .55rem; border-radius: 99px; background: var(--rule); overflow: hidden; }
.clubbar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.clubgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem .3rem; justify-items: center; }
.clubcell { display: flex; flex-direction: column; align-items: center; gap: .2rem; background: none; border: 0; padding: 0; color: inherit; font: inherit; }
button.clubcell { cursor: pointer; }
.clubcell .meta { font-size: .72rem; }
.clubrow { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.clubrowfoot { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; }
#club-dialog { border: 0; border-radius: 14px; padding: 0; width: min(26rem, calc(100vw - 1.5rem)); max-height: calc(100vh - 2rem);
  background: var(--bg); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
#club-dialog::backdrop { background: rgba(15, 20, 28, .55); }
.clubpop { padding: 1.1rem 1.1rem 1rem; border-top: 6px solid var(--accent); }
.clubpop h2 { font: 700 1.8rem/1.1 var(--display); margin: .2rem 0 .3rem; }
.clubimg { display: flex; flex-direction: column; align-items: center; gap: .3rem; min-height: 6rem; justify-content: center; }
.clubimg img { width: 100%; max-width: 18rem; border-radius: 10px; display: block; }
.btnlink { display: inline-block; text-decoration: none; text-align: center; }
.recapclub { display: flex; gap: .8rem; align-items: center; background: var(--good-bg); border-radius: 10px; padding: .6rem .8rem; margin: .2rem 0 .7rem; }
.recapclub strong { font: 700 1.35rem/1.1 var(--display); }

/* Lifts on Today as cards, like the Food cards (2.29): red heavy, blue light, orange accessory.
   A logged lift folds to one line; its heading is the button that folds and opens it. */
.item.liftitem { padding: .45rem 0; border-bottom: 0; }
.liftcard.lc-heavy { --tc: var(--heavy); }
.liftcard.lc-light { --tc: var(--light); }
.liftcard.lc-accessory { --tc: var(--lift); }
.liftcard.lc-deload { --tc: var(--muted); }
.lchead { width: 100%; align-items: center; padding-bottom: .5rem; text-align: left; background: none; border: 0; color: inherit; font: inherit; }
button.lchead { cursor: pointer; }
.lctitle { display: flex; flex-direction: column; gap: .3rem; min-width: 0; flex: 1; }
.lchead h3 { line-height: 1.05; }
.lctags { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.lctags .tag { margin-left: 0; }
.lcscheme { font-size: .78rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); margin-left: .15rem; }
.lcsum { font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lcweight { font: 700 2rem/1 var(--display); white-space: nowrap; color: var(--ink); }
.lcweight small { font-size: .9rem; color: var(--muted); margin-left: .15rem; }
.lcchev { font-size: 1rem; color: var(--muted); margin-left: -.25rem; }
.liftcard.folded .lchead { padding-bottom: .75rem; }
.liftcard.folded .lcweight { font-size: 1.6rem; }
.lcbody { padding: 0 1rem .85rem; }
.lcbody:empty { display: none; }
.liftcard .actions { margin-top: .75rem; }
.lcedit { margin-left: auto; display: flex; align-items: center; }
.lcedit .x { background: none; border: 0; color: var(--muted); font-size: 1.2rem; line-height: 1; padding: .2rem .4rem; }
.liftcard .panel { margin: .5rem 0; }
/* The sets table: every set the same weight, no bold last column; the next weight in the band */
.setstable td, .setstable td:last-child { font-weight: 600; color: var(--ink); text-align: center; }
.setstable thead th:not(:first-child) { text-align: center; }
.setstable thead th:last-child { color: var(--muted); }
.setstable tfoot td, .setstable tfoot td:last-child { text-align: right; font-weight: 700; color: var(--accent); }
@media (max-width: 560px) { .lcbody { padding-left: .75rem; padding-right: .75rem; } }

/* Meals on Food as cards (2.30), like the lift cards: the top edge follows the meal's score
   (green good, amber fair, red needs work), navy for a meal still to come, gray for one passed by */
.mealcard { margin-bottom: .9rem; }
.mealcard.mc-good { --tc: var(--accent); }
.mealcard.mc-fair { --tc: var(--fair); }
.mealcard.mc-bad { --tc: var(--bad); }
.mealcard.mc-next { --tc: var(--navy); }
.mealcard.mc-none { --tc: var(--rule); }
.mealcard.mc-none h3 { color: var(--muted); }
.tag.mccode { color: var(--muted); }
.mcscore { font-size: .74rem; font-weight: 700; padding: .1rem .45rem; border-radius: 6px; }
.mcscore.lv-great { background: var(--great-bg); color: var(--great); }
.mcscore.lv-good { background: var(--good-bg); color: var(--good); }
.mcscore.lv-fair { background: var(--fair-bg); color: var(--fair); }
.mcscore.lv-bad { background: var(--bad-bg); color: var(--bad); }
.mcnums { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; }
.mcpro { font-size: .8rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.mealcard .mealcoach, .mealcard .mealtime { margin: 0 0 .4rem; }
.mealcard .lcbody:first-of-type { padding-bottom: .3rem; }
/* The foods: striped rows across the card, like the totals tables */
.mcfoods { margin: 0; }
.mcfoods li { border-top: 0; padding: .5rem 1rem; }
.mcfoods li:nth-child(odd) { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.mcfoods li.libedit { padding: .5rem 1rem; }
/* Protein, fat and carbs in the dark band */
.mcband { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--band); color: var(--band-ink); padding: .55rem 1rem .6rem; }
.mcband div { display: flex; flex-direction: column; }
.mcband span { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
.mcband strong { font: 700 1.3rem/1.1 var(--display); }
.mcband strong small { font-size: .65em; font-weight: 600; opacity: .7; margin-left: .1em; }
.mealcard .lcbody:last-child { padding-top: .1rem; }
@media (max-width: 560px) { .mcfoods li, .mcband { padding-left: .75rem; padding-right: .75rem; } }

/* Circuits on Today as cards, like the lift cards (2.32): green Full Circuit, teal Core Circuit.
   Logged rounds are a table (a column per round), time and calories in the dark band. */
:root { --core: #12827E; }
@media (prefers-color-scheme: dark) { :root { --core: #4FC4BF; } }
.circuitcard.cc-full { --tc: var(--accent); }
.circuitcard.cc-core { --tc: var(--core); }
.circuitcard .lcweight small { font-family: var(--body); font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-left: .3rem; }
.circuitcard .targets { margin-top: .6rem; }
.circuitcard .lcbody > .meta + .meta { margin-top: .2rem; }
.roundstable thead th { vertical-align: top; }
.roundstable .ccround { display: block; }
.roundstable .ccwait { color: var(--fair); margin-left: .1rem; }
.roundstable .ccdel { display: block; margin: .1rem auto 0; background: none; border: 0; color: var(--muted); font-size: 1rem; line-height: 1; padding: .1rem .3rem; opacity: .7; }
.roundstable tbody th { white-space: normal; }
.roundstable td small { font-size: .6em; }
.roundstable tfoot td, .roundstable tfoot td:last-child { color: var(--band-ink); }
.roundstable tfoot td small { margin-right: .1rem; }
.roundstable td.zero, .roundstable td.zero:last-child { color: color-mix(in srgb, var(--muted) 45%, var(--surface)); font-weight: 600; }

/* Walks on Today as cards (2.33), like the lift and circuit cards: blue top edge, and miles,
   time, pace and calories in the dark band */
.walkcard { --tc: var(--light); }
.walkcard .walkrow:first-child { margin-top: 0; }
.walkcard .wkn { margin-top: .5rem; font-weight: 600; }
/* Outdoor / Treadmill (2.34) */
.walkrow .wkkind { margin: 0 0 .5rem; max-width: 16rem; }
.walkrow .wkincline { margin-top: .5rem; align-items: end; }
.walkrow .wkincline[hidden] { display: none; }
.walkrow .wkroad { grid-column: span 2; margin: 0 0 .45rem; line-height: 1.3; }
.wkband { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 380px) { .wkband strong { font-size: 1.1rem; } }
/* A session's weight training minutes and calories as a card (2.37.1), after its last lift:
   orange top edge like the Weight training card in Totals; lifts, sets, time, calories in the band */
.weightscard { --tc: var(--lift); }
.weightscard .lcbody > .meta { margin: 0 0 .1rem; }
.weightscard .summary { margin-top: .5rem; }

/* By meal on Food as a card (2.35), like the Totals cards: top edge by the day's grade, each meal's
   score and the day's grade in the dark band */
.mealgridcard { margin-bottom: 1.2rem; }
.mealgridcard.mg-good { --tc: var(--accent); }
.mealgridcard.mg-fair { --tc: var(--fair); }
.mealgridcard.mg-bad { --tc: var(--bad); }
.mealgridcard.mg-next { --tc: var(--navy); }
.mealgrid thead th abbr { text-decoration: none; }
.mealgrid tfoot td { font-weight: 700; }
.mealgrid tfoot td small { color: var(--band-ink); }

/* Body scan chart and table on Profile (2.38): strip titles on the stacked muscle chart, and the
   table's picked row and its Scale estimates heading */
.chart .striplabel { fill: var(--ink); font: 700 12.5px var(--body); }
.chart .stripstat { fill: var(--muted); font: 600 12px var(--body); }
.scanchart .liftpick select { min-width: 0; }
.tcard.scantable { --tc: var(--navy); }
.scantable .liftname { background: none; border: 0; cursor: pointer; }
.scantable tr.picked th .liftname { text-decoration-style: solid; color: var(--navy); }
.scantable tr.grouprow { background: none !important; }
.scantable tr.grouprow th { padding-top: .9rem; font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.scantable tr.grouprow th .meta { text-transform: none; letter-spacing: 0; font-weight: 400; }
