/* Transformation Hub styles. Black / white / red, same fonts as the sales page and intake form. */
:root {
  --ink: #0b0b0b; --ink-2: #171717; --ink-3: #141414; --ink-4: #222;
  --chalk: #f2eee6; --muted: rgba(242,238,230,.68); --faint: rgba(242,238,230,.42); --line: rgba(242,238,230,.13);
  --red: #e5322d; --red-soft: rgba(229,50,45,.14); --ok: #7fd18b;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--chalk); }
body { font: 16px/1.5 var(--display); padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) 96px max(16px, env(safe-area-inset-left, 0px)); -webkit-font-smoothing: antialiased; }
a { color: var(--chalk); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { max-width: 640px; margin: 0 auto; }
.wide { max-width: 1100px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 14px; }
.brand { font-weight: 900; letter-spacing: .04em; text-decoration: none; font-size: 18px; }
.brand span { color: var(--red); }
.pill { font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; }
.eyebrow { font: 600 12px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--red); margin: 18px 0 8px; }
h1 { font-size: clamp(30px, 8vw, 44px); line-height: 1.02; letter-spacing: -.02em; margin: 0 0 12px; font-weight: 900; }
h2 { font-size: 24px; line-height: 1.1; margin: 26px 0 12px; font-weight: 800; letter-spacing: -.01em; }
h1 em, h2 em { font-family: var(--serif); font-weight: 400; font-style: italic; color: var(--red); letter-spacing: 0; }
.lede { color: var(--muted); margin: 0 0 18px; }
.muted { color: var(--muted); }
.fine { font-size: 13px; color: var(--faint); }
.card { background: var(--ink-2); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin: 0 0 14px; }
.label { display: block; font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 14px 22px; font: 700 16px var(--display); cursor: pointer; text-decoration: none; min-height: 48px; }
.btn.go { background: var(--red); color: #fff; }
.btn.go:hover { background: #c8201b; }
.btn.ghost { background: transparent; color: var(--chalk); border: 1px solid var(--line); }
.btn.small { padding: 8px 14px; min-height: 36px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.full { width: 100%; }
input, textarea, select { width: 100%; background: var(--ink-3); color: var(--chalk); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; font: 16px var(--display); }
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--red); outline: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 120px; }
.note { background: var(--red-soft); border: 1px solid rgba(229,50,45,.4); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 0 0 14px; }
.okmsg { background: rgba(127,209,139,.1); border: 1px solid rgba(127,209,139,.35); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 0 0 14px; }
ul.ticks { list-style: none; padding: 0; margin: 0; }
ul.ticks li { padding: 8px 0 8px 28px; position: relative; border-top: 1px solid var(--line); }
ul.ticks li:first-child { border-top: 0; }
ul.ticks li::before { content: ""; position: absolute; left: 4px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
ul.ticks li.done::before { background: var(--ok); }

/* Bottom tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(11,11,11,.96); border-top: 1px solid var(--line); display: flex; justify-content: center; padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 5; backdrop-filter: blur(8px); }
.tabs button { flex: 1; max-width: 130px; background: none; border: 0; color: var(--faint); font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 8px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 48px; }
.tabs button svg { width: 22px; height: 22px; }
.tabs button.on { color: var(--chalk); }
.tabs button.on svg { color: var(--red); }

/* Plan pieces */
.tgts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tgt { background: var(--ink-3); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.tgt b { font-size: 30px; font-weight: 900; letter-spacing: -.02em; }
.tgt small { color: var(--faint); margin-left: 4px; }
.pfc { display: flex; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.pfc i { font-style: normal; display: block; color: var(--chalk); font-weight: 700; font-size: 15px; }
.extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 10px; }
.extras div { background: var(--ink-3); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.extras span { display: block; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.extras b { font-size: 16px; }
.pnote { background: var(--ink-3); border-left: 3px solid var(--red); padding: 10px 14px; border-radius: 0 12px 12px 0; color: var(--muted); margin: 0 0 14px; white-space: pre-line; }
details.day { background: var(--ink-2); border: 1px solid var(--line); border-radius: 16px; margin: 0 0 10px; overflow: hidden; }
details.day summary { list-style: none; cursor: pointer; padding: 16px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
details.day summary::-webkit-details-marker { display: none; }
details.day summary::after { content: "+"; margin-left: auto; color: var(--red); font-weight: 900; font-size: 20px; line-height: 1; }
details.day[open] summary::after { content: "–"; }
.dn { font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
details.day summary b { font-size: 18px; }
details.day summary small { color: var(--faint); font-size: 13px; }
ol.exs { list-style: none; margin: 0; padding: 0 16px 10px; counter-reset: ex; }
ol.exs > li { counter-increment: ex; display: grid; grid-template-columns: 26px 1fr auto auto; gap: 10px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
ol.exs > li::before { content: counter(ex); font: 600 12px var(--mono); color: var(--faint); }
ol.exs li small { display: block; color: var(--faint); font-size: 13px; }
.sets { font: 600 13px var(--mono); color: var(--muted); white-space: nowrap; }
.vid { font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: #fff; background: var(--red); padding: 6px 10px; border-radius: 999px; text-decoration: none; }
.seg, .opts { display: flex; gap: 6px; margin: 0 0 12px; flex-wrap: wrap; }
.seg button, .opts button { background: var(--ink-3); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; font: 600 14px var(--display); cursor: pointer; min-height: 40px; }
.seg button.on { background: var(--chalk); color: var(--ink); border-color: var(--chalk); }
.opts button.on { border-color: var(--red); color: var(--chalk); }
.meal { background: var(--ink-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 0 0 10px; }
.mh b { display: block; font-size: 17px; }
.mh small { color: var(--faint); }
.mh .label { margin-bottom: 4px; color: var(--red); }
table.mt { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
table.mt th { text-align: right; font: 600 11px var(--mono); color: var(--faint); letter-spacing: .08em; padding: 4px 4px 6px; border-bottom: 1px solid var(--line); }
table.mt td { text-align: right; padding: 7px 4px; border-bottom: 1px solid var(--line); color: var(--muted); }
table.mt th:first-child, table.mt td:first-child { text-align: left; color: var(--chalk); }
table.mt td:nth-child(2) { white-space: nowrap; }
.daytot { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 14px; margin-bottom: 8px; }
.daytot span { font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.daytot small { color: var(--muted); width: 100%; }

/* Progress */
.chart { width: 100%; height: auto; display: block; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stats div { background: var(--ink-3); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stats b { display: block; font-size: 20px; font-weight: 900; }
.stats span { font-size: 12px; color: var(--faint); }
.hist { list-style: none; padding: 0; margin: 0; }
.hist li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.hist li small { display: block; color: var(--faint); }
.x { background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 18px; padding: 6px 10px; min-height: 36px; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gallery figure { margin: 0; position: relative; }
.gallery img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px; background: var(--ink-3); display: block; }
.gallery figcaption { font-size: 11px; color: var(--faint); margin-top: 4px; }
.week { display: flex; align-items: center; gap: 14px; }
.ring { width: 64px; height: 64px; flex: none; }
.links a { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); text-decoration: none; }
.links a:first-child { border-top: 0; }
.links a::after { content: "→"; color: var(--red); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin 0.9s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
@media (max-width: 420px) { .tgt b { font-size: 24px; } ol.exs > li { grid-template-columns: 22px 1fr auto; } ol.exs > li > .vid { grid-column: 2 / 4; justify-self: start; } }

/* Daily tracker (Progress tab, 1 Dec 2026) */
.daybar { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin: 0 0 6px; }
.daybar .btn.small { font-size: 22px; padding: 4px 16px; }
.dlab { position: relative; text-align: center; cursor: pointer; }
.dlab b { display: block; font-size: 20px; font-weight: 900; }
.dlab span { font-size: 13px; color: var(--faint); }
.dlab input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; padding: 0; }
.savest { text-align: center; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ok); min-height: 18px; margin-bottom: 8px; }
.savest .link { color: var(--red); }
.wk7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 0 0 8px; }
.wk7 button { background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; color: var(--muted); padding: 8px 0 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font: 600 12px var(--mono); min-height: 44px; }
.wk7 button i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--faint); }
.wk7 button.has i { background: var(--red); border-color: var(--red); }
.wk7 button.cur { border-color: var(--chalk); color: var(--chalk); }
.habs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.habs .fine { display: block; margin-bottom: 4px; }
.tg { display: block; font-size: 12px; color: var(--faint); margin-top: 4px; }
.tg.hit { color: var(--ok); }
.tg.hit::before { content: "✓ "; }
.eat { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--muted); }
.eat b { color: var(--chalk); font-size: 20px; font-weight: 900; }
.bar { height: 8px; background: var(--ink-3); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0 14px; }
.bar i { display: block; height: 100%; background: var(--red); border-radius: 99px; }
.mrow { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.tick { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--faint); background: transparent; color: #fff; font-size: 22px; font-weight: 900; cursor: pointer; }
.mrow.on .tick { background: var(--red); border-color: var(--red); }
.mrow.on .mi b { color: var(--muted); }
.mi b { display: block; font-size: 15px; line-height: 1.3; }
.mi small { display: block; color: var(--faint); font-size: 13px; }
.mi .alt { display: grid; gap: 8px; margin-top: 8px; }
.link { background: none; border: 0; padding: 6px 0; min-height: 36px; color: var(--chalk); text-decoration: underline; font: 500 14px var(--display); cursor: pointer; }
.extras-log { display: grid; gap: 8px; margin: 12px 0; }
.xrow { display: grid; grid-template-columns: 1fr 78px 78px 36px; gap: 6px; align-items: center; }
.xrow input, .setrow input, .mi .alt .row input { padding: 11px 10px; }
.exlog { padding: 14px 0; border-top: 1px solid var(--line); }
.exlog:first-of-type { border-top: 0; padding-top: 4px; }
.exh { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.exh .sets { font: 600 13px var(--mono); color: var(--muted); white-space: nowrap; }
.last { display: block; color: var(--ok); font-size: 12px; margin: 2px 0 6px; }
.sethd, .setrow { display: grid; grid-template-columns: 36px 1fr 1fr; gap: 8px; align-items: center; }
.sethd { font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin: 6px 0 4px; }
.setrow { margin-bottom: 6px; }
.setrow > span { text-align: center; font-weight: 800; color: var(--muted); }
.seg button small { font: 600 11px var(--mono); opacity: .7; }
@media (max-width: 420px) { .xrow { grid-template-columns: 1fr 64px 64px 32px; } }
/* Quick-add buttons on habits (3 Dec 2026) */
.qa { display: flex; gap: 6px; margin-top: 6px; }
.qa button { flex: 1 1 0; min-height: 40px; background: var(--ink-3); color: var(--chalk); border: 1px solid var(--line); border-radius: 999px; font: 700 13px var(--display); cursor: pointer; padding: 0 4px; white-space: nowrap; }
.qa button:active { background: var(--red); border-color: var(--red); }
.qa button.on { background: var(--chalk); color: var(--ink); border-color: var(--chalk); }
.hbar { height: 6px; background: var(--ink-3); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.hbar i { display: block; height: 100%; background: var(--red); }
@media (max-width: 380px) { .qa button { font-size: 12px; } }
@media (max-width: 560px) { .habs { grid-template-columns: 1fr; gap: 14px; } }
/* Today screen on Progress (3 Dec 2026): 7 cards and a count */
.todayhd { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; margin: 6px 0 16px; }
.ring7 { position: relative; width: 96px; height: 96px; }
.ring7 svg { width: 100%; height: 100%; }
.ring7 b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 900; letter-spacing: -.02em; }
.ring7 b small { font-size: 16px; color: var(--muted); font-weight: 700; }
.todayhd h1 { font-size: clamp(26px, 7vw, 36px); }
.tcards { display: grid; gap: 10px; margin: 0 0 18px; }
.tc { background: var(--ink-2); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; transition: border-color .2s, box-shadow .2s; }
.tc.done { border-color: rgba(229,50,45,.55); box-shadow: 0 0 22px rgba(229,50,45,.14); background: linear-gradient(180deg, rgba(229,50,45,.1), rgba(229,50,45,.03)), var(--ink-2); }
.tch { width: 100%; display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; background: none; border: 0; color: var(--chalk); padding: 0; cursor: pointer; text-align: left; font: inherit; min-height: 44px; }
.ti { width: 40px; height: 40px; border-radius: 12px; background: var(--ink-4); color: var(--red); display: flex; align-items: center; justify-content: center; }
.ti svg { width: 20px; height: 20px; }
.tc.done .ti { background: var(--red); color: #fff; }
.tn { font-weight: 800; font-size: 16px; line-height: 1.2; }
.tn small { display: block; font-weight: 500; font-size: 12px; color: var(--faint); margin-top: 2px; }
.tv { font-weight: 900; font-size: 20px; white-space: nowrap; }
.tv small { font-size: 13px; color: var(--muted); font-weight: 600; }
.tcheck { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--faint); display: flex; align-items: center; justify-content: center; font-weight: 900; color: #fff; }
.tc.done .tcheck { background: var(--red); border-color: var(--red); }
.tbar { height: 6px; background: var(--ink-3); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.tbar i { display: block; height: 100%; background: var(--red); border-radius: 99px; }
.tb { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.tb .qa { margin: 0 0 4px; }
.tl { display: block; margin: 8px 0 4px; }
/* Exercise swaps (3 Dec 2026) */
.swp { grid-column: 2 / -1; margin-top: 2px; }
details.day .swp summary, .swp summary { display: inline-flex; flex-wrap: nowrap; margin: 0; align-items: center; gap: 6px; cursor: pointer; font: 600 13px var(--display); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; list-style: none; min-height: 34px; }
.swp summary::-webkit-details-marker { display: none; }
details.day .swp summary::after { content: none; }
.swp summary::before { content: "⇄"; color: var(--red); }
.swp[open] summary { color: var(--chalk); border-color: var(--chalk); }
.swp p { font-size: 13px; color: var(--faint); margin: 8px 0 6px; }
.swp ul { list-style: none; padding: 0; margin: 0; }
.swp li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.swapsel { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; }
.swapsel span { font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.swapsel select { padding: 8px 10px; font-size: 14px; }
.savest.warn { color: var(--chalk); }
/* Add to home screen card (3 Dec 2026) */
.install { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: start; border-color: rgba(229,50,45,.45); }
.install img { border-radius: 12px; }
.install b { display: block; font-size: 17px; }
.isteps { margin: 0 0 6px; padding-left: 20px; font-size: 14px; color: var(--muted); }
.isteps li { margin: 3px 0; }
.isteps b { display: inline; font-size: 14px; color: var(--chalk); }
