/* ==========================================================================
   ALPHA SHRED — member app
   Same inks as the site: paper, black, red as the rare accent.
   Bandit(Anton) shouts, Inter talks, DM Mono labels. App-lean: no scroll theater.
   ========================================================================== */
:root {
  --paper: #ECECE9;
  --ink: #000000;
  --red: #DE0604;
  --white: #FFFFFF;
  --gray-2: #D5D1CE;
  --gray-3: #292929;
  --display: "Bandit Condensed", "Anton", Impact, "Arial Narrow", sans-serif;
  --sans: "Messina Sans", "Inter", system-ui, -apple-system, sans-serif;
  --mono: "Messina Sans Mono", "DM Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.65, .01, .05, .99);
  --pad: clamp(14px, 4vw, 24px);
  --top-h: 56px;
  --tabs-h: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-weight: 300; font-size: 15px; line-height: 1.4; letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.mono { font-family: var(--mono); font-weight: 400; text-transform: uppercase; letter-spacing: -.03em; }
.disp { font-family: var(--display); font-weight: 400; text-transform: uppercase; line-height: .9; }

/* grain */
.grain { position: fixed; inset: -60% 0 0 -60%; width: 220%; height: 220%; background: url("../assets/noise.png") repeat 0 0/160px 160px; opacity: .16; pointer-events: none; z-index: 90; }

/* top bar */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: calc(var(--top-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--pad) 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(236, 236, 233, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ink);
}
.top__logo { height: 18px; width: auto; }
.top__label { font-size: 12px; }
.top__right { display: flex; align-items: center; gap: 10px; }
.top__left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top__back { font-size: 13px; line-height: 1; border: 1px solid var(--ink); border-radius: 4px; padding: 5px 9px 4px; background: var(--paper); }
.top__acct { font-size: 11px; text-transform: uppercase; border: 1px solid var(--ink); border-radius: 4px; padding: 5px 9px; background: var(--paper); }
body.is-gated .tabs { display: none; }
body.is-gated .view { padding-bottom: 40px; }

/* layout */
.view { padding: calc(var(--top-h) + env(safe-area-inset-top) + 16px) var(--pad) calc(var(--tabs-h) + env(safe-area-inset-bottom) + 28px); max-width: 760px; margin: 0 auto; }

/* bottom tabs */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--ink); color: var(--paper);
}
.tabs__item { display: flex; align-items: center; justify-content: center; position: relative; }
.tabs__word { font-family: var(--display); text-transform: uppercase; font-size: clamp(12px, 3.4vw, 17px); white-space: nowrap; line-height: 1; letter-spacing: .02em; opacity: .5; transition: opacity .2s; padding-top: 2px; }
.tabs__item.is-active .tabs__word { opacity: 1; }
.tabs__item.is-active::after { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; background: var(--red); }

/* shared bits */
.eyebrow { font-family: var(--mono); font-weight: 400; text-transform: uppercase; font-size: 12px; letter-spacing: -.03em; }
.rule { border: 0; border-top: 1px solid var(--ink); margin: 0; }
.sechead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-top: 1px solid var(--ink); padding-top: 8px; margin: 26px 0 12px; }
.sechead:first-child { margin-top: 0; }
.muted { opacity: .55; }
.red { color: var(--red); }

/* TODAY */
.day__kicker { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.day__title { font-size: clamp(52px, 15vw, 96px); margin: 8px 0 2px; }
.day__note { max-width: 34em; margin: 8px 0 2px; }
.daynav { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 4px; }
.venueseg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--ink); border-radius: 5px; overflow: hidden; margin: 18px 0 4px; }
.venueseg__btn { font-family: var(--mono); font-weight: 400; text-transform: uppercase; font-size: 12px; letter-spacing: -.02em; padding: 14px 10px 12px; text-align: center; position: relative; transition: background .2s, color .2s; }
.venueseg__btn + .venueseg__btn { border-left: 1px solid var(--ink); }
.venueseg__btn.is-active { background: var(--ink); color: var(--paper); }
.venueseg__btn.is-active::after { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; background: var(--red); }
.venueseg__hint { font-size: 10px; margin: 6px 0 2px; }
.daynav button { font-family: var(--mono); font-size: 12px; text-transform: uppercase; padding: 8px 10px; border: 1px solid var(--ink); border-radius: 4px; background: var(--paper); }
.daynav button:disabled { opacity: .3; cursor: default; }

.xrow { border-bottom: 1px solid var(--ink); }
.xrow__head { width: 100%; display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; text-align: left; padding: 14px 0; }
.xrow__num { font-family: var(--mono); font-size: 11px; opacity: .55; }
.xrow__name { font-family: var(--display); text-transform: uppercase; font-size: clamp(20px, 5.6vw, 28px); line-height: .95; }
.xrow__scheme { font-family: var(--mono); font-size: 11px; text-align: right; white-space: nowrap; }
.xrow__meta { font-family: var(--mono); font-size: 10px; opacity: .5; margin-top: 3px; }
.xrow__video { height: 0; overflow: hidden; transition: height .45s var(--ease); }
.xrow__frame { position: relative; padding-top: 56.25%; background: #000; margin-bottom: 14px; }
.xrow__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.xrow__lines { margin: 2px 0 14px; }
.xline { font-family: var(--mono); font-weight: 400; font-size: 11px; text-transform: uppercase; letter-spacing: -.02em; line-height: 1.45; padding: 5px 0 5px 14px; position: relative; opacity: .8; }
.xline::before { content: ""; position: absolute; left: 0; top: 11px; width: 6px; height: 2px; background: var(--red); }
.xrow__vlabel { font-size: 10px; opacity: .6; margin: 2px 0 8px; }
.xrow.is-open { background: var(--ink); color: var(--paper); margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); }
.xrow.is-open .xrow__num { color: var(--red); opacity: 1; }
.xrow--flat .xrow__head { cursor: default; }
.xrow--done .xrow__name { text-decoration: line-through; text-decoration-thickness: 3px; }

/* rest day */
.restcard { border: 1px solid var(--ink); border-radius: 5px; padding: 20px 18px 16px; margin-top: 18px; }
.restcard__line { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(22px, 6.4vw, 38px); line-height: .95; margin: 0 0 10px; }
.restcard__line:last-child { margin-bottom: 0; }

.closeday { display: block; width: 100%; margin: 26px 0 8px; background: var(--ink); color: var(--paper); font-family: var(--display); text-transform: uppercase; font-size: 26px; padding: 18px 16px 14px; border-radius: 5px; transition: background .25s, transform .2s; }
.closeday:active { transform: scale(.985); }
.closeday.is-done { background: var(--red); color: #fff; }
.day__closednote { text-align: center; margin-top: 10px; }

.photo-card { border: 1px solid var(--ink); border-radius: 5px; padding: 14px; margin-top: 18px; display: flex; gap: 12px; align-items: baseline; }
.photo-card b { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 20px; }

/* PROGRAM */
.prog__head { display: flex; justify-content: space-between; align-items: baseline; }
.prog__title { font-size: clamp(44px, 12vw, 80px); margin: 6px 0 14px; }
.prog__grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pcell {
  aspect-ratio: 1; border: 1px solid var(--ink); border-bottom-left-radius: 7px; position: relative;
  display: flex; flex-direction: column; justify-content: space-between; padding: 6px; text-align: left;
  transition: background .2s, color .2s;
}
.pcell__num { font-family: var(--display); font-size: clamp(16px, 4.4vw, 24px); line-height: 1; }
.pcell__tag { font-family: var(--mono); font-size: 8px; text-transform: uppercase; letter-spacing: -.02em; opacity: .6; }
.pcell.is-done { background: var(--ink); color: var(--paper); }
.pcell.is-done .pcell__tag { opacity: .7; }
.pcell.is-today { border-width: 2px; }
.pcell.is-today::after { content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; background: var(--red); border-radius: 2px; }
.pcell.is-done.is-today { background: var(--red); border-color: var(--red); color: #fff; }
.prog__legend { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.prog__stat b { font-family: var(--display); font-weight: 400; font-size: 22px; margin-right: 5px; }
.startcard { border: 1px solid var(--ink); border-radius: 5px; padding: 16px; margin-bottom: 18px; }
.startcard .closeday { margin: 12px 0 0; }

/* LIBRARY */
.lib__title { font-size: clamp(44px, 12vw, 80px); margin: 6px 0 10px; }
.lib__filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 4px; }
.chip { font-family: var(--mono); font-size: 11px; text-transform: uppercase; border: 1px solid var(--ink); border-radius: 4px; padding: 6px 9px; transition: background .15s, color .15s; }
.chip.is-active { background: var(--ink); color: var(--paper); }
.lib__search { width: 100%; font: inherit; font-size: 15px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--ink); background: transparent; outline: none; margin-bottom: 4px; }
.lib__search:focus { border-bottom-color: var(--red); }
.lib__count { margin: 8px 0 2px; }

/* FUEL: quiz + plan */
.qhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.qback { font-size: 12px; text-transform: uppercase; padding: 8px 10px; border: 1px solid var(--ink); border-radius: 4px; background: var(--paper); }
.qtitle { font-size: clamp(48px, 14vw, 88px); margin: 6px 0 2px; }
.qopts { margin-top: 16px; border-top: 1px solid var(--ink); }
.qopt { width: 100%; text-align: left; display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: baseline; padding: 15px 0 13px; border-bottom: 1px solid var(--ink); }
.qopt__label { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(22px, 6vw, 30px); line-height: .95; }
.qopt__desc { font-size: 11px; opacity: .55; margin-top: 3px; }
.qopt.is-selected { background: var(--ink); color: var(--paper); margin: 0 calc(-1 * var(--pad)); padding: 15px var(--pad) 13px; }
.qopt.is-selected .xrow__num { color: var(--red); opacity: 1; }
.qopt.is-selected .qopt__desc { opacity: .7; }
.qlanes { padding: 12px 0 14px; border-bottom: 1px solid var(--ink); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.qform { margin-top: 6px; }
.qfield { margin: 20px 0; }
.qlabel { display: block; font-size: 11px; margin-bottom: 6px; }
.qin { width: 100%; font: inherit; font-size: 17px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--ink); background: transparent; outline: none; border-radius: 0; }
.qin:focus { border-bottom-color: var(--red); }
.qrow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.qseg { margin: 2px 0 0; }
.unitseg { display: flex; gap: 6px; margin: 2px 0 8px; }
.qerr { display: none; font-size: 11px; margin: 14px 0 0; }
.qerr:not(:empty) { display: block; }
.plan__hero { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 6px 0 4px; }
.plan__cal { font-size: clamp(72px, 24vw, 140px); line-height: .9; }
.plan__unit { font-size: 12px; }
.plan__tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 16px 0 6px; }
.mtile { border: 1px solid var(--ink); border-radius: 5px; border-bottom-left-radius: 9px; padding: 12px 10px 10px; }
.mtile b { display: block; font-weight: 400; font-size: clamp(24px, 7vw, 34px); line-height: 1; }
.mtile .mono { font-size: 10px; opacity: .6; }
.frow { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--ink); padding: 11px 0 9px; font-family: var(--mono); font-weight: 400; text-transform: uppercase; font-size: 11px; letter-spacing: -.02em; }
.frow__wrap { text-align: right; max-width: 60%; }
.plan__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.qghost { font-size: 12px; text-transform: uppercase; border: 1px solid var(--ink); border-radius: 4px; padding: 13px 10px; background: var(--paper); }
.mealwindow { font-size: 11px; text-transform: uppercase; letter-spacing: -.02em; border: 1px solid var(--ink); border-radius: 4px; padding: 10px 12px; margin: 4px 0 14px; }
.weekchips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.weekchips::-webkit-scrollbar { display: none; }
.weekchips .chip { flex: 0 0 auto; }
.grocbtn { display: block; width: 100%; margin: 0 0 12px; }
.swaphint { font-size: 10px; opacity: .55; text-transform: uppercase; margin: -6px 0 12px; }
/* A tradeable food carries a visible Swap control. The old affordance was
   a dotted underline on 11px caps, which on a phone is not a control at
   all: members could not find the feature and assumed it did not exist. */
.mitem--swap { width: 100%; text-align: left; cursor: pointer; }
.mitem__name { min-width: 0; overflow-wrap: anywhere; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.mitem__right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.mitem__qty { white-space: nowrap; }
.mitem__swap {
  font-size: 9.5px; letter-spacing: -.01em; white-space: nowrap;
  border: 1px solid var(--red); color: var(--red); border-radius: 3px;
  padding: 3px 6px 2px; display: inline-flex; align-items: center; gap: 4px;
  transition: background .18s, color .18s;
}
.mitem__caret { font-size: 8px; transition: transform .2s var(--ease); }
.mitem--swap.is-open .mitem__swap { background: var(--red); color: var(--white); }
.mitem--swap.is-open .mitem__caret { transform: rotate(180deg); }
.mitem__swap--lock { border-color: var(--ink); color: var(--ink); opacity: .45; }
.mitem__flag { font-size: 8.5px; color: var(--red); border: 1px solid var(--red); border-radius: 2px; padding: 1px 4px 0; }
.mitem--swap.is-swapped .mitem__name { color: var(--red); }
@media (hover: hover) {
  .mitem--swap:hover .mitem__swap { background: var(--red); color: var(--white); }
}
.mitem--swap:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
.mswap { display: none; padding: 9px 0 13px; border-top: 1px dashed rgba(0, 0, 0, .35); }
.mswap.is-open { display: block; }
.mswap__label { font-size: 10px; opacity: .55; display: block; margin-bottom: 7px; }
.mswap__chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mswap__note { font-size: 9px; opacity: .5; display: block; margin-top: 8px; }
.chip--auto { border-color: var(--red); color: var(--red); }
.mealcard { border: 1px solid var(--ink); border-radius: 5px; border-bottom-left-radius: 9px; padding: 14px 14px 12px; margin: 0 0 10px; }
.mealcard__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.mealcard__name { font-size: clamp(24px, 6.6vw, 34px); margin: 8px 0 10px; }
.mitem { display: flex; justify-content: space-between; gap: 14px; font-family: var(--mono); font-weight: 400; text-transform: uppercase; font-size: 11px; letter-spacing: -.02em; padding: 7px 0; border-top: 1px dashed rgba(0, 0, 0, .35); }
.mitem > span:last-child { text-align: right; }
.mealcard__macros { font-size: 11px; margin-top: 10px; color: var(--red); }
.mealcard__season { font-size: 10px; opacity: .55; margin-top: 6px; text-transform: uppercase; }
.mealnote { font-size: 10px; opacity: .55; margin: 12px 0 2px; text-transform: uppercase; line-height: 1.6; }

/* exercise close */
.xrow__close { display: block; margin: 2px 0 12px auto; font-size: 10px; text-transform: uppercase; letter-spacing: -.02em; border: 1px solid currentColor; border-radius: 4px; padding: 6px 10px; background: transparent; color: inherit; }

/* grocery entry + check-off */
.grocmain { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 12px; text-align: left; border: 2px solid var(--ink); border-radius: 5px; border-bottom-left-radius: 9px; background: var(--paper); padding: 14px 14px 12px; margin: 0 0 12px; }
.grocmain__label { font-family: var(--display); text-transform: uppercase; font-size: clamp(20px, 5.6vw, 26px); line-height: 1; }
.grocmain__range { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: -.02em; text-align: right; }
.grocmain__arrow { color: var(--red); }
.gitem { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--ink); padding: 11px 0 9px; font-family: var(--mono); font-weight: 400; text-transform: uppercase; font-size: 11px; letter-spacing: -.02em; }
.gitem__box { flex: 0 0 auto; width: 14px; height: 14px; border: 1px solid var(--ink); border-radius: 3px; }
.gitem__name { flex: 1; }
.gitem__qty { text-align: right; white-space: nowrap; }
.gitem.is-done { opacity: .45; }
.gitem.is-done .gitem__name, .gitem.is-done .gitem__qty { text-decoration: line-through; }
.gitem.is-done .gitem__box { background: var(--red); border-color: var(--red); }

/* member dashboard */
a.dashcard { text-decoration: none; }
.dashcard { display: block; border: 1px solid var(--ink); border-radius: 5px; border-bottom-left-radius: 9px; background: var(--paper); color: inherit; padding: 16px 14px 13px; margin: 0 0 10px; }
.dashcard--ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.dashcard__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.dashcard__title { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(30px, 8vw, 42px); line-height: .95; margin: 8px 0 6px; letter-spacing: .005em; }
.dashcard__sub { font-size: 11px; text-transform: uppercase; letter-spacing: -.02em; opacity: .75; }
.dashcard__arrow { color: var(--red); font-size: 16px; }
.dashcard__done { color: var(--red); }
.dashrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 10px; }
.dashcard--up { border: 2px solid var(--red); }
.chip--lock { opacity: .45; }
.dashrow .dashcard { margin: 0; }
.dashrow .dashcard__title { font-size: clamp(20px, 5.6vw, 28px); }

/* training log inside an exercise */
.xlog { margin-top: 14px; border-top: 1px dashed currentColor; padding-top: 12px; }
.xlog__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.xlog__last { text-align: right; flex: 1; }
.lsets { display: flex; flex-direction: column; gap: 8px; }
.lset { display: grid; grid-template-columns: 20px 1fr 14px 1fr 28px; gap: 8px; align-items: center; }
.lset__n { font-size: 11px; opacity: .6; }
.lset__x { font-size: 10px; opacity: .5; text-align: center; }
.lin { width: 100%; font: inherit; font-family: var(--mono); font-size: 14px; padding: 9px 8px; border: 1px solid currentColor; border-radius: 4px; background: transparent; color: inherit; outline: none; -moz-appearance: textfield; }
.lin::-webkit-outer-spin-button, .lin::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.lin:focus { border-color: var(--red); }
.lin::placeholder { opacity: .45; }
.lset__del { font-size: 15px; line-height: 1; opacity: .5; background: transparent; border: 0; color: inherit; padding: 4px; }
.lset__del:hover { opacity: 1; color: var(--red); }
.laddset { display: block; width: 100%; margin-top: 10px; font-size: 11px; text-transform: uppercase; letter-spacing: -.02em; padding: 9px; border: 1px dashed currentColor; border-radius: 4px; background: transparent; color: inherit; }
.lnote { width: 100%; margin-top: 8px; font: inherit; font-size: 14px; padding: 9px 8px; border: 1px solid currentColor; border-radius: 4px; background: transparent; color: inherit; outline: none; }
.lnote:focus { border-color: var(--red); }
.lsaved { font-size: 10px; text-transform: uppercase; letter-spacing: -.02em; color: var(--red); min-height: 14px; margin-top: 6px; }

/* check-in trend */
.trend { margin: 18px 0 10px; border: 1px solid var(--ink); border-radius: 5px; border-bottom-left-radius: 9px; padding: 12px 12px 8px; color: var(--red); }
.trend svg { display: block; width: 100%; height: 90px; }
.trend__dot { fill: var(--red); }
.trend__ends { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink); opacity: .55; margin-top: 4px; }
.qgrid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 420px) { .qgrid2 { grid-template-columns: 1fr; } }

/* progress checkpoints */
a.photo-card--cta { text-decoration: none; color: inherit; justify-content: space-between; }
.cpgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 4px; }
.cpcard { border: 1px solid var(--ink); border-radius: 5px; border-bottom-left-radius: 9px; padding: 9px; display: flex; flex-direction: column; gap: 7px; }
.cpcard__head { display: flex; justify-content: space-between; font-size: 10px; }
.cpcard__note { font-size: 9px; opacity: .55; line-height: 1.4; }
.cpshot { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 3px; background: rgba(0,0,0,.06); }
.cpshot--empty, .cpshot--vid, .cpshot--load { display: flex; align-items: center; justify-content: center; font-size: 10px; text-transform: uppercase; letter-spacing: -.02em; opacity: .5; border: 1px dashed var(--ink); }
.cpadd { display: block; text-align: center; font-size: 10px; text-transform: uppercase; letter-spacing: -.02em; padding: 8px 4px; border: 1px solid var(--ink); border-radius: 4px; cursor: pointer; }
.cpadd:hover { background: var(--ink); color: var(--paper); }
.cmpgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 14px 0; }
.cmp { margin: 0; }
.cmp figcaption { font-size: 10px; text-transform: uppercase; letter-spacing: -.02em; opacity: .6; margin-top: 5px; text-align: center; }
.pdel { font-size: 10px; text-transform: uppercase; letter-spacing: -.02em; background: transparent; border: 0; color: var(--red); padding: 0 0 0 8px; }
@media (max-width: 380px) { .cpcard__note { display: none; } }

/* challenge */
.frow--me { color: var(--red); font-weight: 500; }
.admbox { border: 1px solid var(--red); border-radius: 5px; border-bottom-left-radius: 9px; padding: 12px; margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.admbox__head { font-size: 10px; color: var(--red); }
.admbox .qin { font-size: 14px; padding: 8px 6px; border: 1px solid var(--ink); border-radius: 4px; }
.admbox select.qin { background: var(--paper); color: var(--ink); }
.admbox .qghost { padding: 9px; }

/* community */
.cmtform { display: flex; gap: 8px; align-items: stretch; margin: 12px 0 18px; }
.cmtform .qin { flex: 1; border: 1px solid var(--ink); border-radius: 4px; padding: 10px 9px; font-size: 15px; }
.cmtform .qghost, .cmtform .closeday { flex: 0 0 auto; width: auto; margin: 0; font-size: 12px; padding: 10px 14px; }
.cmtform--new { flex-direction: column; }
.cmtform--new .closeday { width: 100%; font-size: 20px; padding: 14px; }
.post { border-top: 1px solid var(--ink); padding: 14px 0 12px; }
.post__head { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 7px; }
.post__body { font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.post__acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pact { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: -.02em; border: 1px solid var(--ink); border-radius: 4px; padding: 5px 8px; background: transparent; color: inherit; }
.pact:hover { background: var(--ink); color: var(--paper); }
.pact.is-on { background: var(--red); border-color: var(--red); color: #fff; }
.pact--warn { border-color: var(--red); color: var(--red); }
.pact--warn:hover { background: var(--red); border-color: var(--red); color: #fff; }
.repbox { border: 1px solid var(--red); border-radius: 5px; padding: 10px; margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.repbox__head { flex: 1 0 100%; font-size: 10px; color: var(--red); }
.thread { margin: 12px 0 0 12px; padding-left: 12px; border-left: 2px solid var(--line-soft, rgba(0,0,0,.18)); }
.cmt { padding: 9px 0; border-bottom: 1px dashed rgba(0,0,0,.2); }
.cmt:last-of-type { border-bottom: 0; }
.cmt__head { display: flex; justify-content: space-between; font-size: 10px; margin-bottom: 5px; }
.cmt__body { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }

/* avatars */
.av { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 11px; letter-spacing: -.02em; flex: 0 0 auto; }
.av--none { background: var(--ink); }
.av--msg { width: 30px; height: 30px; font-size: 10px; }
.av--ring { width: 52px; height: 52px; font-size: 14px; border: 2px solid var(--paper); }
.av--big { width: 72px; height: 72px; font-size: 22px; }
.avrow { display: flex; align-items: center; gap: 14px; margin: 12px 0 6px; }
.avrow .cpadd { flex: 1; }

/* stories rail */
.rail { display: flex; gap: 12px; overflow-x: auto; padding: 14px 0 6px; -webkit-overflow-scrolling: touch; }
.rail::-webkit-scrollbar { display: none; }
.ringwrap { flex: 0 0 auto; background: transparent; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; width: 62px; color: inherit; }
.ring { display: inline-flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 50%; border: 2px solid rgba(0,0,0,.25); }
.ring--new { border-color: var(--red); }
.ring--add { border-style: dashed; }
.ring__plus { font-size: 22px; line-height: 1; opacity: .6; }
.ring__name { font-size: 9px; max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the room */
.room { border: 1px solid var(--ink); border-radius: 6px; border-bottom-left-radius: 12px; padding: 12px 10px; max-height: 58vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.daysplit { text-align: center; font-size: 9px; opacity: .5; padding: 6px 0 2px; }
.msg { display: flex; gap: 9px; align-items: flex-start; }
.msg--run { margin-top: -6px; }
.msg__spacer { flex: 0 0 30px; }
.msg__col { min-width: 0; flex: 1; }
.msg__who { font-size: 10px; margin-bottom: 3px; display: flex; align-items: center; gap: 6px; min-height: 14px; }

/* the way into a message's actions. Visible on every message, because a
   control you have to discover by accident is not a control. */
.msg__more {
  margin-left: auto; flex: 0 0 auto; background: transparent; color: inherit;
  border: 1px solid var(--ink); border-radius: 4px; padding: 1px 6px 3px;
  font-size: 11px; line-height: 1; letter-spacing: .08em; opacity: .55;
}
.msg__more:hover, .msg.is-acts .msg__more { opacity: 1; background: var(--ink); color: var(--paper); }

/* a message staff took down, still on screen for staff and its author */
.msg--hidden .msg__bubble { opacity: .5; text-decoration: line-through; }
.msg--hidden .msg__bubble { border: 1px dashed var(--red); }
.msg__bubble { display: inline-block; background: var(--card, rgba(0,0,0,.06)); border-radius: 4px 12px 12px 12px; padding: 8px 11px; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; max-width: 100%; }
.msg--mine .msg__bubble { background: var(--ink); color: var(--paper); border-radius: 12px 4px 12px 12px; }
/* actions reveal on tap, because a phone has no hover */
.msg__acts { display: none; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.msg.is-acts .msg__acts, .msg:focus-within .msg__acts { display: flex; }
@media (hover: hover) { .msg:hover .msg__acts { display: flex; } }
.msg__bubble { cursor: pointer; }
.saybar { display: flex; gap: 8px; margin: 12px 0 4px; }
.saybar .qin { flex: 1; border: 1px solid var(--ink); border-radius: 4px; padding: 12px 10px; font-size: 16px; }
.saybar .qghost { flex: 0 0 auto; padding: 12px 16px; }

/* who can see this room: stated to everyone, member or not */
.whosees {
  font-size: 10px; line-height: 1.5; text-transform: uppercase; letter-spacing: -.01em;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  padding: 7px 0; margin: 0 0 14px; opacity: .75;
}

/* the composer, replaced, for an account that can read but not post */
.saylock { border: 1px solid var(--ink); border-radius: 6px; border-bottom-left-radius: 12px; padding: 14px 12px; margin: 12px 0 4px; }
.saylock__t { font-size: 11px; text-transform: uppercase; color: var(--red); margin-bottom: 6px; }
.saylock__b { font-size: 13px; line-height: 1.45; margin-bottom: 12px; }
.saylock .closeday { width: 100%; margin: 0; }

/* the story slot a non-member cannot fill */
.ringwrap--off { opacity: .45; }
.ring--off { border-style: dotted; }

/* story reel */
.reel { position: fixed; inset: 0; z-index: 120; background: #000; color: #fff; display: flex; flex-direction: column; }
.reel__bars { display: flex; gap: 4px; padding: 12px 12px 8px; }
.reel__bar { flex: 1; height: 2px; background: rgba(255,255,255,.3); border-radius: 2px; }
.reel__bar.is-on { background: #fff; }
.reel__close { position: absolute; top: 26px; right: 14px; z-index: 2; background: transparent; border: 0; color: #fff; font-size: 11px; text-transform: uppercase; letter-spacing: -.02em; }
.reel__stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.reel__media { max-width: 100%; max-height: 100%; object-fit: contain; }
.reel__load { color: #fff; font-size: 11px; text-transform: uppercase; }
.reel__nav { position: absolute; top: 0; bottom: 0; width: 40%; background: transparent; border: 0; }
.reel__nav--prev { left: 0; } .reel__nav--next { right: 0; }
.reel__cap { padding: 10px 16px; font-size: 15px; }
.reel__foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px 26px; font-size: 11px; }
.reel__foot .pact { color: #fff; border-color: #fff; }

/* inbox */
.dmrow { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--ink); padding: 12px 0; color: inherit; }
.dmrow__col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dmrow__top { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; }
.dmrow__last { font-size: 13px; opacity: .7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dmrow__dot { flex: 0 0 auto; min-width: 20px; height: 20px; border-radius: 10px; background: var(--red); color: #fff; font-family: var(--mono); font-size: 10px; display: flex; align-items: center; justify-content: center; padding: 0 6px; }

/* the hidden attribute must beat any display rule below it */
[hidden] { display: none !important; }

/* notification bell */
.top__bell { position: relative; font-size: 12px; font-weight: 500; border: 1px solid var(--ink); border-radius: 4px; padding: 5px 10px; background: var(--paper); color: inherit; }
.bell__dot { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font-family: var(--mono); font-size: 9px; display: flex; align-items: center; justify-content: center; }

/* alerts */
.noterow { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--ink); text-decoration: none; color: inherit; }
.noterow.is-unread { border-left: 2px solid var(--red); padding-left: 10px; margin-left: -12px; }
.noterow__kind { flex: 0 0 62px; font-size: 9px; opacity: .6; padding-top: 2px; }
.noterow__col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.noterow__title { font-size: 14px; }
.noterow__body { font-size: 12px; opacity: .6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.noterow__when { flex: 0 0 auto; font-size: 9px; }

/* admin */
.admtabs { display: flex; gap: 6px; overflow-x: auto; padding: 14px 0 8px; }
.admtabs::-webkit-scrollbar { display: none; }
.admtabs .chip { flex: 0 0 auto; }
.admrow { border-bottom: 1px solid var(--ink); padding: 11px 0; display: flex; flex-direction: column; gap: 4px; }
.admrow__top { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.admrow__sub { font-size: 10px; overflow-wrap: anywhere; }
.admrow__acts { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.admrow__acts .pact { text-decoration: none; }
.pgbody { font-family: var(--mono); font-size: 13px; line-height: 1.6; resize: vertical; min-height: 180px; padding: 10px; }
.pgtext { max-width: 62ch; }
.pgtext p { font-size: 15.5px; line-height: 1.65; margin: 0 0 14px; }

/* membership: plan picker and the terms block.
   The terms sit above the button on purpose. Nothing about the charge
   date or the amount hides behind a link. */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 4px; }
.seg__btn { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left;
  border: 1px solid var(--ink); border-radius: 5px; border-bottom-left-radius: 9px; background: var(--paper);
  color: var(--ink); padding: 13px 12px 11px; cursor: pointer; font: inherit; }
.seg__btn.is-on { background: var(--ink); color: var(--paper); }
.seg__name { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 21px; line-height: 1; }
.seg__price { font-size: 10px; text-transform: uppercase; letter-spacing: -.02em; opacity: .75; }
.seg__btn.is-on .seg__price { opacity: .8; }
.terms { border: 2px solid var(--red); border-radius: 5px; border-bottom-left-radius: 9px; padding: 4px 13px 6px; margin: 12px 0 16px; }
.terms__line { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; border-bottom: 1px solid var(--gray-2); }
.terms__line:last-child { border-bottom: 0; }
.terms__line span { font-size: 10px; text-transform: uppercase; letter-spacing: -.02em; color: var(--red); }
.terms__line b { font-weight: 500; font-size: 13.5px; line-height: 1.5; }

/* ---- the drawer: the whole app in one list ----
   Same bracketed labels and condensed display type as everywhere else.
   Nav gets bigger, the voice does not change. */
.top__menu { font-size: 11px; text-transform: uppercase; border: 1px solid var(--ink); border-radius: 4px; padding: 5px 9px; background: var(--ink); color: var(--paper); }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 60; opacity: 0; transition: opacity .22s var(--ease); }
.scrim.is-open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(360px, 88vw); background: var(--paper);
  border-left: 2px solid var(--ink); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .24s var(--ease);
  padding-top: env(safe-area-inset-top);
}
.drawer.is-open { transform: translateX(0); }
.drawer__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px var(--pad) 11px; border-bottom: 2px solid var(--ink); flex: 0 0 auto; }
.drawer__x { font-size: 21px; line-height: 1; border: 1px solid var(--ink); border-radius: 4px; padding: 1px 8px 3px; background: var(--paper); color: inherit; }
.drawer__body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px var(--pad) calc(26px + env(safe-area-inset-bottom)); flex: 1 1 auto; }
.dgroup { margin-top: 18px; }
.dgroup__label { display: block; border-bottom: 1px solid var(--ink); padding-bottom: 6px; margin-bottom: 4px; }
.dgroup__label.red { color: var(--red); }
.ditem { display: flex; flex-direction: column; gap: 1px; padding: 10px 0 9px; border-bottom: 1px solid var(--gray-2); text-decoration: none; color: inherit; }
.ditem:last-child { border-bottom: 0; }
.ditem__name { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 21px; line-height: 1.05; }
.ditem__note { font-size: 9.5px; text-transform: uppercase; letter-spacing: -.02em; opacity: .55; }
.ditem.is-on .ditem__name { color: var(--red); }
.ditem:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
body.no-scroll { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .drawer, .scrim { transition: none; }
}

/* the allergy line: always present, always a link, on the meal plan and the
   shop both, so the setting is never something a member has to go find */
.alrow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--ink); border-radius: 4px; padding: 10px 12px 9px; margin: 14px 0 4px;
  text-decoration: none; color: inherit; background: var(--paper); }
.alrow--on { border: 2px solid var(--red); }
.alrow__k { font-size: 10px; opacity: .6; }
.alrow--on .alrow__k { color: var(--red); opacity: 1; }
.alrow__v { font-size: 11.5px; text-align: right; }
.alrow--on .alrow__v { color: var(--red); }
.alrow:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* safety notice: an allergy is not a preference, so it does not get styled
   like a hint. Red rule, full contrast, no fading it into the page. */
.safety { border: 2px solid var(--red); border-radius: 5px; border-bottom-left-radius: 9px;
  padding: 13px 14px 12px; margin: 18px 0 6px; display: flex; flex-direction: column; gap: 5px; }
.safety b { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 18px; line-height: 1; }
.safety span { font-size: 13px; line-height: 1.5; }
.safety--slim { margin: 12px 0 4px; padding: 11px 12px 10px; }
.safety--slim b { font-size: 15px; }
.safety--slim span { font-size: 11.5px; }

/* armed destructive buttons: the second tap is the one that destroys */
.pact.is-armed, .pdel.is-armed { background: var(--red); color: var(--white); border-color: var(--red); }
.qghost.is-armed, .closeday.is-armed { background: var(--red); color: var(--white); border-color: var(--red); }
.qerr.is-warn { display: block; color: var(--ink); border-left: 3px solid var(--red); padding-left: 9px; }

/* the shop: count on the left, clear on the right, list starts right below */
.grocbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 14px 0 2px; }
.grocbar .swaphint { margin: 0; }

/* misc */
.empty { padding: 30px 0; text-align: center; }
::selection { background: var(--ink); color: var(--paper); }
@media (min-width: 700px) {
  body { font-size: 16px; }
  .prog__grid { grid-template-columns: repeat(6, 1fr); }
  .tabs__word { font-size: 22px; }
}

/* ---- desktop: the dashboard is a dashboard ----
   On a wide screen the home stack becomes a real grid so the workout, the
   meal plan and the numbers sit side by side above the fold instead of
   stretching one phone column across a monitor. Only #home changes shape;
   every reading screen keeps its measure. */
@media (min-width: 900px) {
  .view { max-width: 1140px; }
  .view.view--home .dashgrid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 12px; align-items: start;
  }
  .view.view--home .dashgrid > .dashrow { display: contents; }
  .view.view--home .dashgrid .dashcard { margin: 0; height: 100%; }
  /* the two anchors carry the top row */
  .view.view--home .dashgrid .dashcard--wide { grid-column: span 2; }
  .view.view--home .dashcard__title { font-size: 26px; }
  .view.view--home .dashgrid .dashcard--ink .dashcard__title { font-size: 30px; }
}
@media (min-width: 1180px) {
  .view.view--home .dashgrid { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .xrow__video { transition: none; }
}

/* which build is loaded, so a stale cache is never mistaken for a bug */
.buildline { font-size: 9px; opacity: .45; text-align: right; padding: 14px 0 4px; letter-spacing: .04em; }
