/* ============================================================
   FORMA — Online Fit Club
   Liquid chrome + glassmorphism, monochrome steel
   ============================================================ */

:root {
  --ink: #0b0b0c;
  --ink-60: rgba(11, 11, 12, .6);
  --ink-40: rgba(11, 11, 12, .4);
  --steel-1: #f5f5f7;
  --steel-2: #e3e3e8;
  --steel-3: #c9c9d1;
  --steel-4: #a3a3ad;
  --glass: rgba(255, 255, 255, .52);
  --glass-strong: rgba(255, 255, 255, .72);
  --glass-border: rgba(255, 255, 255, .75);
  --shadow: 0 18px 40px -18px rgba(20, 20, 28, .35);
  --r-lg: 26px;
  --r-md: 20px;
  --chrome-grad: linear-gradient(108deg, #fdfdfe 0%, #9a9aa4 22%, #eeeef2 41%, #62626c 58%, #f6f6f8 76%, #83838d 100%);
  --font-main: "Archivo", "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: var(--font-main);
  color: var(--ink);
  background: linear-gradient(155deg, #eeeef1 0%, #d4d4db 34%, #f2f2f5 58%, #b9b9c3 100%) fixed;
  overflow-x: hidden;
}

/* ---------- background scene ---------- */
.bg-scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px) saturate(.2);
  opacity: .85;
  background:
    conic-gradient(from 200deg at 50% 50%,
      #ffffff 0deg, #6f6f7a 70deg, #f0f0f4 130deg,
      #55555f 200deg, #ffffff 260deg, #8d8d98 320deg, #ffffff 360deg);
  animation: drift 26s ease-in-out infinite alternate;
}
.blob-a { width: 62vmin; height: 62vmin; top: -14vmin; right: -18vmin; }
.blob-b { width: 48vmin; height: 48vmin; bottom: 6vmin; left: -20vmin; animation-delay: -9s; animation-duration: 32s; }
.blob-c { width: 34vmin; height: 34vmin; top: 42%; right: -10vmin; animation-delay: -17s; opacity: .6; }

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(-5vmin, 4vmin, 0) rotate(40deg) scale(1.08); }
  100% { transform: translate3d(3vmin, -5vmin, 0) rotate(-30deg) scale(.95); }
}

.grain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  opacity: .055; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- typography ---------- */
.mono-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-60);
}
.mono-tag.dim { color: var(--ink-40); }

.h-display {
  font-size: clamp(44px, 13vw, 62px);
  font-weight: 900;
  line-height: .9;
  letter-spacing: -.045em;
  text-transform: uppercase;
}

.chrome-text {
  background: var(--chrome-grad);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: chrome-slide 7s ease-in-out infinite alternate;
}
@keyframes chrome-slide { from { background-position: 0% 0; } to { background-position: 100% 0; } }

/* ---------- buttons ---------- */
.btn-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  color: #fff;
  background: var(--ink);
  border: none;
  border-radius: 999px;
  padding: 15px 26px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .5);
  white-space: nowrap;
}
.btn-pill:active { transform: scale(.96); }
.btn-block { width: 100%; }

.btn-ghost {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--ink);
  background: rgba(255, 255, 255, .4);
  border: 1px solid rgba(11, 11, 12, .22);
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
  transition: transform .15s ease;
}
.btn-ghost:active { transform: scale(.96); }

/* ---------- glass card ---------- */
.glass-card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  box-shadow: var(--shadow);
  padding: 20px;
}

/* ============================================================
   SPLASH
============================================================ */
.splash {
  position: relative; z-index: 5;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
}
.splash-top { display: flex; justify-content: space-between; }
.splash-center { position: relative; }

.splash-blob {
  position: absolute;
  top: 50%; right: -30px;
  width: 210px; height: 210px;
  transform: translateY(-58%);
  border-radius: 42% 58% 56% 44% / 48% 42% 58% 52%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.95) 0 8%, transparent 42%),
    conic-gradient(from 210deg, #f8f8fa, #5c5c66 80deg, #ececf0 150deg, #3f3f49 215deg, #fafafb 290deg, #8f8f9a, #f8f8fa);
  filter: blur(1.5px);
  box-shadow: inset -18px -22px 38px rgba(0,0,0,.38), inset 14px 16px 30px rgba(255,255,255,.85), 0 30px 60px -20px rgba(20,20,30,.45);
  animation: liquid 11s ease-in-out infinite alternate;
}
@keyframes liquid {
  0%   { border-radius: 42% 58% 56% 44% / 48% 42% 58% 52%; transform: translateY(-58%) rotate(0deg); }
  50%  { border-radius: 58% 42% 44% 56% / 42% 56% 44% 58%; transform: translateY(-52%) rotate(9deg); }
  100% { border-radius: 46% 54% 60% 40% / 56% 46% 54% 44%; transform: translateY(-60%) rotate(-7deg); }
}

.splash-title {
  position: relative; z-index: 2;
  font-size: clamp(64px, 21vw, 104px);
  font-weight: 900;
  line-height: .86;
  letter-spacing: -.05em;
  text-transform: uppercase;
}
.splash-sub { display: block; margin-top: 18px; }

.splash-list { list-style: none; display: grid; gap: 9px; margin-bottom: 22px; }
.splash-list li {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  color: var(--ink-60);
  display: flex; gap: 12px;
  border-top: 1px solid rgba(11,11,12,.14);
  padding-top: 9px;
}
.splash-list li span { color: var(--ink-40); }
.splash-note { display: block; text-align: center; margin-top: 12px; }

/* ============================================================
   APP SHELL
============================================================ */
.app {
  position: relative; z-index: 5;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 0 18px calc(112px + env(safe-area-inset-bottom));
}

.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 2px 12px;
  background: linear-gradient(to bottom, rgba(232,232,237,.9), rgba(232,232,237,0));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.logo { font-weight: 900; font-size: 20px; letter-spacing: -.04em; }
.logo sup { font-size: 9px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 12px; }

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  color: #fff;
  background: linear-gradient(140deg, #55555f, #17171b);
  border: 1px solid rgba(255,255,255,.6);
}
.avatar.big { width: 46px; height: 46px; flex: none; }

/* screens */
.screen { display: none; animation: rise .35s ease; }
.screen.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.section-head { margin: 10px 0 18px; }
.section-head .h-display { margin-top: 6px; }

/* ---------- day strip ---------- */
.daystrip {
  display: flex; gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.daystrip::-webkit-scrollbar { display: none; }
.day {
  flex: none;
  min-width: 52px;
  padding: 10px 8px;
  border-radius: 16px;
  text-align: center;
  background: rgba(255,255,255,.34);
  border: 1px solid rgba(255,255,255,.55);
  backdrop-filter: blur(10px);
}
.day span { display: block; font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em; color: var(--ink-40); }
.day b { font-size: 16px; font-weight: 800; }
.day.active { background: var(--ink); border-color: var(--ink); }
.day.active span { color: rgba(255,255,255,.55); }
.day.active b { color: #fff; }

/* ---------- kcal card ---------- */
.kcal-card { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: center; margin-bottom: 14px; }

.kcal-gauge { position: relative; }
.gauge-svg { width: 100%; display: block; }
.gauge-track, .gauge-fill {
  fill: none;
  stroke-width: 13;
  stroke-linecap: round;
}
.gauge-track { stroke: rgba(11,11,12,.1); }
.gauge-fill {
  stroke: url(#gaugeGrad);
  stroke: #17171b;
  stroke-dasharray: 251;
  stroke-dashoffset: 251;
  transition: stroke-dashoffset 1.1s cubic-bezier(.6,0,.2,1);
}
.gauge-val { position: absolute; inset: auto 0 0; text-align: center; }
.gauge-val b { display: block; font-size: 34px; font-weight: 900; letter-spacing: -.04em; line-height: 1; }
.gauge-val .mono-tag { font-size: 8.5px; }

.macros { display: grid; gap: 12px; }
.macro-row { display: grid; gap: 5px; }
.m-name { font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; color: var(--ink-60); }
.m-bar { height: 6px; border-radius: 99px; background: rgba(11,11,12,.1); overflow: hidden; }
.m-bar i {
  display: block; height: 100%; width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #4a4a54, #17171b);
  transition: width .9s cubic-bezier(.6,0,.2,1);
}
.m-val { font-size: 8.5px; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.tile { padding: 16px; display: grid; gap: 8px; border-radius: var(--r-md); }
.tile b { font-size: 24px; font-weight: 900; letter-spacing: -.03em; }
.tile b span { font-size: 24px; }
.tile-bar { height: 5px; border-radius: 99px; background: rgba(11,11,12,.1); overflow: hidden; }
.tile-bar i { display: block; height: 100%; background: var(--ink); border-radius: 99px; transition: width .5s ease; }
.tile-sub { font-size: 8.5px; }
.tile-add {
  font-family: var(--font-mono); font-size: 9px; font-weight: 600; letter-spacing: .12em;
  border: 1px dashed rgba(11,11,12,.3);
  background: none; border-radius: 99px;
  padding: 6px; cursor: pointer; color: var(--ink-60);
}

/* ---------- program card ---------- */
.program-card { margin-bottom: 14px; }
.program-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.program-top h3 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 3px; }

.ring-mini { position: relative; width: 52px; height: 52px; flex: none; }
.ring-mini svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rm-track, .rm-fill { fill: none; stroke-width: 5; }
.rm-track { stroke: rgba(11,11,12,.1); }
.rm-fill { stroke: var(--ink); stroke-dasharray: 119; stroke-linecap: round; }
.ring-mini span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
}

.week-dots { display: flex; justify-content: space-between; margin-top: 16px; }
.wd { text-align: center; display: grid; gap: 6px; justify-items: center; }
.wd span { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .1em; color: var(--ink-40); }
.wd i { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid rgba(11,11,12,.2); }
.wd.done i { background: var(--ink); border-color: var(--ink); }
.wd.today i { border-color: var(--ink); border-width: 2px; box-shadow: 0 0 0 4px rgba(11,11,12,.08); }
.wd.planned i { background: rgba(11,11,12,.12); border-color: transparent; }

/* ---------- today workout / curator ---------- */
.today-workout { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.tw-info h3 { font-size: 22px; font-weight: 900; letter-spacing: -.02em; margin: 4px 0; }

.curator-card { display: flex; gap: 14px; align-items: center; }
.cur-body p { font-size: 13.5px; font-weight: 500; line-height: 1.35; margin-top: 5px; }
.cur-dot { width: 9px; height: 9px; border-radius: 50%; background: #17171b; margin-left: auto; flex: none; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .14em;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(11,11,12,.18);
  background: rgba(255,255,255,.38);
  color: var(--ink-60);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all .18s ease;
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- program list ---------- */
.program-list { display: grid; gap: 14px; }
.pcard { overflow: hidden; padding: 0; }
.pcard-visual {
  position: relative;
  height: 118px;
  background:
    radial-gradient(circle at 78% 20%, rgba(255,255,255,.9), transparent 45%),
    linear-gradient(120deg, #d8d8de, #8e8e99 45%, #d0d0d7 70%, #6e6e78);
  display: flex; align-items: flex-end;
  padding: 14px;
}
.pcard-visual::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  opacity: .12; mix-blend-mode: multiply;
}
.pcard-num {
  position: absolute; top: 10px; right: 14px;
  font-size: 54px; font-weight: 900; letter-spacing: -.05em;
  color: rgba(255,255,255,.5);
  line-height: 1;
}
.pcard-level {
  position: relative; z-index: 2;
  font-family: var(--font-mono); font-size: 9px; font-weight: 600; letter-spacing: .14em;
  background: rgba(255,255,255,.8);
  border-radius: 99px; padding: 6px 12px;
}
.pcard-body { padding: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pcard-body h3 { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.pcard-body .mono-tag { display: block; margin-top: 4px; }

/* ---------- food ---------- */
.food-summary { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.fs-main b { font-size: 44px; font-weight: 900; letter-spacing: -.04em; line-height: 1; display: block; }
.fs-side { text-align: right; display: grid; gap: 8px; }
.fs-row b { font-size: 20px; font-weight: 800; margin-left: 8px; }

.ai-card { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; overflow: hidden; }
.ai-card::before {
  content: "";
  position: absolute; top: -46px; right: -40px;
  width: 130px; height: 130px;
  border-radius: 46% 54% 58% 42% / 50% 44% 56% 50%;
  background: conic-gradient(from 190deg, #fafafb, #6a6a75 90deg, #eeeef1 160deg, #4a4a54 230deg, #fbfbfc 310deg, #9a9aa5, #fafafb);
  filter: blur(2px);
  opacity: .55;
  animation: liquid 9s ease-in-out infinite alternate;
}
.ai-card h3 { font-size: 17px; font-weight: 800; letter-spacing: -.01em; margin: 4px 0; position: relative; }
.ai-card > div { position: relative; }
.ai-card .btn-pill { position: relative; }

.meal-card { margin-bottom: 14px; }
.meal-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.meal-head h3 { font-size: 16px; font-weight: 800; letter-spacing: .01em; }
.meal-kcal { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; color: var(--ink-60); }
.meal-items { display: grid; }
.food-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(11,11,12,.08);
}
.food-item:last-child { border-bottom: none; }
.fi-name { font-size: 13.5px; font-weight: 600; }
.fi-meta { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; color: var(--ink-40); display: block; margin-top: 2px; }
.fi-kcal { font-family: var(--font-mono); font-size: 11px; font-weight: 600; white-space: nowrap; }
.meal-empty { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; color: var(--ink-40); padding: 10px 0; }
.meal-add {
  width: 100%;
  margin-top: 8px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .14em;
  padding: 11px;
  border: 1px dashed rgba(11,11,12,.3);
  border-radius: 14px;
  background: none; cursor: pointer; color: var(--ink-60);
}

/* ---------- recipes ---------- */
.recipe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rcard { padding: 0; overflow: hidden; cursor: pointer; transition: transform .15s ease; }
.rcard:active { transform: scale(.97); }
.rcard-visual {
  position: relative; height: 96px;
  display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 10px;
}
.rcard-visual::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  opacity: .14; mix-blend-mode: multiply;
}
.rcard-kcal {
  position: relative; z-index: 2;
  font-family: var(--font-mono); font-size: 8.5px; font-weight: 600; letter-spacing: .1em;
  background: rgba(255,255,255,.85);
  padding: 5px 9px; border-radius: 99px;
}
.rcard-body { padding: 12px 14px 14px; }
.rcard-body h4 { font-size: 13.5px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.rcard-body .mono-tag { display: block; margin-top: 6px; font-size: 8.5px; }

/* recipe sheet */
.recipe-sheet { max-height: 82dvh; overflow-y: auto; }
.rs-visual { height: 130px; border-radius: 18px; position: relative; overflow: hidden; margin-bottom: 16px; }
.rs-head h3 { font-size: 24px; font-weight: 900; letter-spacing: -.03em; text-transform: uppercase; line-height: 1; }
.rs-macros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.rs-m { background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.7); border-radius: 14px; padding: 10px 6px; text-align: center; }
.rs-m b { display: block; font-size: 16px; font-weight: 800; }
.rs-m span { font-family: var(--font-mono); font-size: 8px; letter-spacing: .12em; color: var(--ink-40); }
.rs-block { margin: 14px 0; }
.rs-block .mono-tag { display: block; margin-bottom: 8px; }
.rs-block li { list-style: none; font-size: 13.5px; font-weight: 500; padding: 7px 0; border-bottom: 1px solid rgba(11,11,12,.07); display: flex; justify-content: space-between; gap: 10px; }
.rs-block li span { font-family: var(--font-mono); font-size: 10px; color: var(--ink-40); white-space: nowrap; }
.rs-block ol { padding-left: 18px; }
.rs-block ol li { display: list-item; border: none; padding: 4px 0; }

/* ---------- more ---------- */
.measure-card { margin-bottom: 20px; }
.mc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.mc-top b { display: block; font-size: 36px; font-weight: 900; letter-spacing: -.04em; margin: 4px 0 2px; }
.mc-top small { font-size: 16px; font-weight: 700; }
.spark { width: 100%; height: 56px; }
.spark polyline { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.spark circle { fill: var(--ink); }
.spark-labels { display: flex; justify-content: space-between; margin-top: 6px; font-size: 8.5px; }

.block-label { display: block; margin: 20px 4px 10px; }
.list-card { padding: 6px 20px; }
.lrow {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(11,11,12,.08);
}
.lrow:last-child { border-bottom: none; }
.lrow b { font-size: 14px; font-weight: 700; display: block; letter-spacing: -.01em; }
.lrow .mono-tag { margin-top: 3px; display: block; }
.lprog { font-weight: 600; }
.lplay { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 9px; }

.tariffs { display: grid; gap: 12px; }
.tariff { display: grid; gap: 6px; justify-items: start; padding: 18px 20px; }
.tariff b { font-size: 28px; font-weight: 900; letter-spacing: -.03em; }
.tariff .btn-ghost, .tariff .btn-pill { margin-top: 8px; }
.tariff.featured { border: 1.5px solid var(--ink); background: var(--glass-strong); }
.feat-tag {
  position: absolute; top: -9px; right: 16px;
  background: var(--ink); color: #fff;
  padding: 4px 12px; border-radius: 99px;
  font-size: 8.5px;
}

.footer-note { display: block; text-align: center; margin: 28px 0 8px; font-size: 8.5px; }

/* ============================================================
   TAB BAR
============================================================ */
.tabbar {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 40;
  width: min(440px, calc(100% - 24px));
  display: flex;
  background: rgba(250, 250, 252, .68);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 999px;
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  box-shadow: 0 22px 44px -16px rgba(15, 15, 22, .45);
  padding: 7px;
}
.tab {
  flex: 1;
  display: grid; justify-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  padding: 9px 2px;
  border-radius: 999px;
  color: var(--ink-40);
  transition: all .18s ease;
}
.tab svg { width: 19px; height: 19px; fill: currentColor; }
.tab span { font-family: var(--font-mono); font-size: 7.5px; font-weight: 600; letter-spacing: .12em; }
.tab.active { background: var(--ink); color: #fff; }

/* ============================================================
   WORKOUT OVERLAY
============================================================ */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: linear-gradient(155deg, #ececef 0%, #cfcfd6 40%, #eeeef1 70%, #b6b6c0 100%);
  overflow-y: auto;
  padding: 0 18px 130px;
  animation: rise .3s ease;
}
.overlay[hidden] { display: none; }

.ov-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 0 12px;
  background: linear-gradient(to bottom, rgba(232,232,236,.95), rgba(232,232,236,0));
}
.ov-header h3 { font-size: 21px; font-weight: 900; letter-spacing: -.02em; }
.ov-back {
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  border: 1px solid rgba(11,11,12,.2);
  background: rgba(255,255,255,.5);
  font-size: 16px; cursor: pointer;
}
.session-time { margin-left: auto; font-weight: 600; font-size: 12px; }

.ov-progress { margin: 8px 0 18px; display: grid; gap: 8px; }
.ovp-bar { height: 7px; border-radius: 99px; background: rgba(11,11,12,.12); overflow: hidden; }
.ovp-bar i { display: block; height: 100%; width: 0%; background: var(--ink); border-radius: 99px; transition: width .4s ease; }

.ov-body { display: grid; gap: 14px; }

.ex-card { padding: 18px; }
.ex-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ex-head h4 { font-size: 16.5px; font-weight: 800; letter-spacing: -.01em; }
.ex-head .mono-tag { display: block; margin-top: 3px; }
.ex-num { font-family: var(--font-mono); font-size: 10px; color: var(--ink-40); }

.set-row {
  display: grid;
  grid-template-columns: 30px 1fr 1fr 40px;
  align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(11,11,12,.07);
}
.set-row:last-of-type { border-bottom: none; }
.set-num { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--ink-40); }
.set-cell { text-align: center; }
.set-cell b { font-size: 15px; font-weight: 700; }
.set-cell span { font-family: var(--font-mono); font-size: 8px; letter-spacing: .12em; color: var(--ink-40); display: block; }
.set-check {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid rgba(11,11,12,.28);
  background: none;
  cursor: pointer;
  justify-self: end;
  display: grid; place-items: center;
  color: transparent;
  font-size: 13px;
  transition: all .18s ease;
}
.set-check.done { background: var(--ink); border-color: var(--ink); color: #fff; }

.rest-timer {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 55;
  width: min(440px, calc(100% - 32px));
  background: rgba(20, 20, 24, .92);
  color: #fff;
  border-radius: 22px;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  backdrop-filter: blur(16px);
  animation: rise .25s ease;
}
.rest-timer .mono-tag { color: rgba(255,255,255,.5); }
.rest-timer b { font-size: 24px; font-weight: 900; letter-spacing: -.02em; }
.rt-bar { flex: 1; height: 6px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: hidden; }
.rt-bar i { display: block; height: 100%; width: 100%; background: #fff; border-radius: 99px; transition: width 1s linear; }
.rest-timer .btn-ghost { border-color: rgba(255,255,255,.35); color: #fff; background: none; padding: 9px 14px; }

.ov-footer {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: min(440px, calc(100% - 32px));
  z-index: 54;
}

/* done overlay */
.done-overlay { display: flex; align-items: center; justify-content: center; text-align: center; }
.done-overlay[hidden] { display: none; }
.done-center { max-width: 360px; width: 100%; display: grid; gap: 16px; justify-items: center; padding: 40px 0; }
.done-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.ds { padding: 16px 8px; display: grid; gap: 4px; }
.ds b { font-size: 20px; font-weight: 900; letter-spacing: -.02em; }
.ds .mono-tag { font-size: 8px; }

/* ============================================================
   SHEETS
============================================================ */
.sheet-wrap { position: fixed; inset: 0; z-index: 70; }
.sheet-wrap[hidden] { display: none; }
.sheet-back { position: absolute; inset: 0; background: rgba(15, 15, 20, .45); backdrop-filter: blur(3px); animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: 0;
  width: min(480px, 100%);
  background: rgba(244, 244, 247, .96);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 28px 28px 0 0;
  backdrop-filter: blur(26px);
  padding: 12px 20px calc(24px + env(safe-area-inset-bottom));
  animation: slideup .32s cubic-bezier(.5,0,.2,1);
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
}
@keyframes slideup { from { transform: translate(-50%, 60px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

.sheet-grip { width: 42px; height: 4px; border-radius: 99px; background: rgba(11,11,12,.18); margin: 0 auto 14px; }
.sheet-head h3 { font-size: 20px; font-weight: 900; letter-spacing: -.02em; }
.sheet-head .mono-tag { display: block; margin: 4px 0 12px; }

.search {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(11,11,12,.16);
  background: rgba(255,255,255,.7);
  outline: none;
  color: var(--ink);
  margin-bottom: 10px;
}
.search::placeholder { color: var(--ink-40); }

.food-results { overflow-y: auto; flex: 1; min-height: 120px; }
.fres {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(11,11,12,.08);
  cursor: pointer;
}
.fres-name { font-size: 14px; font-weight: 600; }
.fres-meta { font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; color: var(--ink-40); display: block; margin-top: 2px; }
.fres-add {
  width: 30px; height: 30px; flex: none;
  border-radius: 50%;
  border: 1.5px solid rgba(11,11,12,.25);
  background: none;
  display: grid; place-items: center;
  font-size: 15px;
  color: var(--ink-60);
}
.fres.selected { background: rgba(255,255,255,.65); border-radius: 14px; }
.fres.selected .fres-add { background: var(--ink); border-color: var(--ink); color: #fff; }

.portion { border-top: 1px solid rgba(11,11,12,.12); padding-top: 14px; margin-top: 8px; display: grid; gap: 12px; }
.portion-info b { font-size: 16px; font-weight: 800; }
.portion-info .mono-tag { display: block; margin-top: 3px; }
.portion-ctrl { display: flex; align-items: center; justify-content: center; gap: 22px; }
.p-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(11,11,12,.22);
  background: rgba(255,255,255,.6);
  font-size: 20px;
  cursor: pointer;
}
.p-val { text-align: center; }
.p-val b { font-size: 30px; font-weight: 900; letter-spacing: -.03em; display: block; }
.portion-kcal { text-align: center; font-size: 11px; font-weight: 600; }

/* toast */
.toast {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(104px + env(safe-area-inset-bottom));
  z-index: 90;
  background: var(--ink); color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 10px;
  box-shadow: 0 14px 30px -10px rgba(0,0,0,.5);
  animation: rise .25s ease;
  white-space: nowrap;
}
.toast[hidden] { display: none; }

/* ============================================================
   PHOTOS & VALENTINA
============================================================ */
.photo {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  filter: grayscale(1) contrast(1.06);
}
.photo::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(15, 15, 20, .48), rgba(15, 15, 20, 0) 58%);
}

.trainer-chip {
  position: relative; z-index: 2;
  margin-top: 22px;
  display: flex; align-items: center; gap: 12px;
  max-width: 320px;
}
.trainer-chip img {
  width: 52px; height: 52px; flex: none;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .85);
  box-shadow: 0 10px 24px -10px rgba(20, 20, 30, .5);
  filter: grayscale(1) contrast(1.05);
}
.trainer-chip b { display: block; font-size: 14px; font-weight: 800; letter-spacing: .02em; margin-bottom: 3px; }

.goal-card { margin-bottom: 14px; display: grid; gap: 10px; }
.goal-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.goal-top h3 { font-size: 22px; font-weight: 900; letter-spacing: -.02em; margin-top: 4px; }
.goal-badge {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .1em;
  background: var(--ink); color: #fff;
  padding: 7px 12px; border-radius: 99px;
}
.goal-bar { height: 7px; }

.coach-ava {
  width: 46px; height: 46px; flex: none;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .75);
  filter: grayscale(1) contrast(1.05);
}

.tw-thumb {
  width: 58px; height: 58px; flex: none;
  border-radius: 18px;
  overflow: hidden;
}
.tw-thumb img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.06); }

.coach-hero { margin-bottom: 20px; display: grid; gap: 14px; }
.ch-top { display: flex; gap: 14px; align-items: center; }
.ch-photo {
  width: 74px; height: 74px; flex: none;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .75);
  filter: grayscale(1) contrast(1.05);
}
.ch-top h3 { font-size: 25px; font-weight: 900; letter-spacing: -.03em; margin: 3px 0; }
.ch-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ch-stats > div {
  background: rgba(255, 255, 255, .42);
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 14px;
  padding: 11px 4px;
  text-align: center;
  display: grid; gap: 4px;
}
.ch-stats b { font-size: 17px; font-weight: 900; letter-spacing: -.02em; }
.ch-stats .mono-tag { font-size: 7.5px; }
.ch-quote { font-size: 13.5px; font-weight: 500; line-height: 1.45; }

/* ---------- desktop ---------- */
@media (min-width: 560px) {
  body { display: block; }
  .h-display { font-size: 56px; }
}
