/* ==========================================================================
   PULSE — стили. Один файл, одна система.
   Правило: в компонентах НЕТ «зашитых» цветов — только переменные ниже.
   Тёмная тема — по умолчанию, светлая включается data-theme="light" на <html>
   (селектор :root[data-theme="light"] сильнее :root, поэтому порядок не важен).
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/_desktop/690418f64dcf65949b74056b5def2b1eac158fdf/fonts/inter-cyrillic-wght-normal.woff2") format("woff2-variations"), url("/_desktop/690418f64dcf65949b74056b5def2b1eac158fdf/fonts/inter-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/_desktop/690418f64dcf65949b74056b5def2b1eac158fdf/fonts/inter-latin-wght-normal.woff2") format("woff2-variations"), url("/_desktop/690418f64dcf65949b74056b5def2b1eac158fdf/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- токены: тёмная тема ---------- */
:root {
  --bg: #090D0C;
  --bg-glow: rgba(203, 254, 247, .07);
  --surface: #121817;
  --surface-2: #192120;
  --surface-3: #212B29;
  --line: #243030;
  --line-strong: #36443F;
  --text: #F2F7F6;
  --text-2: #9DAAA8;
  --text-3: #6E7B79;

  --accent: #CBFEF7;            /* фирменный мятный */
  --accent-text: #CBFEF7;       /* иконки, ссылки, активные пункты */
  --accent-soft: rgba(203, 254, 247, .10);
  --accent-border: rgba(203, 254, 247, .28);
  --primary: #CBFEF7;           /* заливка главных кнопок и выбранных состояний */
  --primary-ink: #06110F;
  --bubble: #CBFEF7;            /* свои сообщения в чате */
  --bubble-ink: #06110F;

  --protein: #CBFEF7;
  --fat: #FFB86B;
  --carbs: #A9A4FF;
  --warn: #FF8F80;
  --warn-soft: rgba(255, 143, 128, .13);
  --ok: #8FE9BB;
  --ok-soft: rgba(143, 233, 187, .12);
  --track: #243030;
  --overlay: rgba(0, 0, 0, .62);
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --tabbar-bg: rgba(9, 13, 12, .94);
  --skeleton: #1A2221;
  --skeleton-hi: #232D2B;
  color-scheme: dark;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --tap: 44px;                  /* минимальная тач-цель (Apple HIG / WCAG 2.5.5) */
  --tabbar-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --vvh: 100dvh;                /* высота видимой области, обновляется из JS (клавиатура iOS) */
}

/* ---------- токены: светлая тема ---------- */
:root[data-theme="light"] {
  --bg: #F3F6F5;
  --bg-glow: rgba(10, 122, 108, .06);
  --surface: #FFFFFF;
  --surface-2: #EEF3F2;
  --surface-3: #E3EAE8;
  --line: #DCE4E2;
  --line-strong: #BFCBC8;
  --text: #0D1514;
  --text-2: #4F5E5B;
  --text-3: #66736F;

  --accent: #CBFEF7;
  --accent-text: #086B5F;       /* мятный на белом нечитаем — для текста/иконок тёмная бирюза (≥5:1 даже на серых плашках) */
  --accent-soft: rgba(10, 122, 108, .09);
  --accent-border: rgba(10, 122, 108, .32);
  --primary: #0A7A6C;           /* главные кнопки светлой темы — фирменная бирюза с белым текстом (5,3:1) */
  --primary-ink: #FFFFFF;
  --bubble: #CBFEF7;
  --bubble-ink: #0D1514;

  --protein: #0A7A6C;
  --fat: #C46A12;
  --carbs: #5B54D6;
  --warn: #C8372A;
  --warn-soft: rgba(200, 55, 42, .09);
  --ok: #157A47;
  --ok-soft: rgba(21, 122, 71, .10);
  --track: #E2E9E7;
  --overlay: rgba(13, 21, 20, .45);
  --shadow: 0 16px 44px rgba(16, 36, 32, .14);
  --tabbar-bg: rgba(255, 255, 255, .94);
  --skeleton: #E7EDEB;
  --skeleton-hi: #F3F6F5;
  color-scheme: light;
}

/* ---------- база ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--bg);
}
html, body { min-height: 100%; }
body {
  margin: 0;
  /* Safari 26 красит свои панели по сплошному фону body — поэтому цвет отдельно от градиента */
  background-color: var(--bg);
  background-image: radial-gradient(1200px 600px at 85% -10%, var(--bg-glow), transparent 70%);
  background-attachment: fixed;
  color: var(--text);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: clamp(26px, 2.6vw, 32px); line-height: 1.15; font-weight: 800; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 700; }
h3, h2.h3 { font-size: 16px; line-height: 1.35; font-weight: 600; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 8px; }
[tabindex="-1"]:focus { outline: none; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.num { font-weight: 700; font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
/* у CSS-сетки колонка по умолчанию растягивается под самый длинный неразрывный текст —
   поэтому везде явно minmax(0, 1fr): содержимое сжимается, а не вылезает за экран */
.list, .skeleton-wrap, .meal-items, .ex-list, .builder, .complete-list, .settings, .conv-list, .agenda, .macros, .results { grid-template-columns: minmax(0, 1fr); }
.list > *, .stack > *, .settings > *, .agenda > * { min-width: 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 140px; min-width: 0; }

.skip-link {
  position: fixed; left: 12px; top: calc(8px + var(--safe-t)); z-index: 200;
  padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--primary); color: var(--primary-ink); font-weight: 700;
  transform: translateY(-150%); transition: transform .15s;
}
.skip-link:focus { transform: none; }

/* ---------- каркас: меню слева на компьютере, нижнее меню на телефоне ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100dvh; }
.rail {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 4px;
  padding: calc(22px + var(--safe-t)) 12px 18px;
  border-right: 1px solid var(--line);
  background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 12px 22px; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-border); }
.brand-mark svg { width: 18px; height: 18px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: var(--tap); padding: 10px 12px; border-radius: 12px;
  color: var(--text-2); font-weight: 500; text-decoration: none;
}
.nav-link svg { width: 22px; height: 22px; flex: none; }
@media (hover: hover) { .nav-link:hover { color: var(--text); background: var(--surface); text-decoration: none; } }
.nav-link[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav-link[aria-current="page"] svg { color: var(--accent-text); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: inline-grid; place-items: center;
  background: var(--primary); color: var(--primary-ink);
  font-size: 12px; font-weight: 700; line-height: 1;
}
.nav-link .badge { margin-left: auto; }
.rail-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--text-2); text-decoration: none; }
.rail-foot:hover { background: var(--surface); text-decoration: none; }
.rail-foot-text { display: grid; min-width: 0; }
.rail-foot-text b { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-foot-text span { font-size: 13px; }

main { width: 100%; min-width: 0; max-width: 1180px; padding: calc(28px + var(--safe-t)) clamp(16px, 4vw, 44px) 48px; }
main:focus { outline: none; }
.page { width: 100%; min-width: 0; }
.page.narrow { max-width: 760px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.page-head > div:first-child { min-width: 0; }
.page-head p { margin-top: 4px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 2px; min-height: var(--tap); margin: -10px 0 0 -6px; padding: 0 6px; color: var(--text-2); font-size: 15px; }
.back svg { width: 20px; height: 20px; }
.back:hover { color: var(--text); text-decoration: none; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 26px 0 12px; }
.section-title h2, h2.section-title { font-size: 18px; }
.link-btn { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 4px; font-weight: 600; font-size: 15px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.toolbar > p { flex: 1 1 260px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: 15px; line-height: 1.2; white-space: nowrap; text-decoration: none;
  transition: background-color .15s, border-color .15s, transform .1s, filter .15s;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { border-color: var(--text-3); text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.danger { color: var(--warn); }
.btn.danger:not(.ghost) { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }
.btn[aria-busy="true"] { opacity: .75; cursor: progress; }
.icon-btn {
  position: relative; flex: none;
  width: var(--tap); height: var(--tap); border-radius: 50%;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  text-decoration: none; touch-action: manipulation;
}
.icon-btn:hover { text-decoration: none; border-color: var(--line-strong); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.plain { background: transparent; border-color: transparent; color: var(--text-2); }
.icon-btn.plain:hover { color: var(--text); background: var(--surface-2); }
.icon-btn.del:hover { color: var(--warn); }
.icon-btn .badge { position: absolute; top: -4px; right: -4px; }
.icon-btn:disabled { opacity: .45; }

/* ---------- формы ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label { font-size: 14px; font-weight: 500; color: var(--text-2); }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--text);
  font-size: 16px;               /* 16px — иначе iOS увеличивает страницу при фокусе */
  -webkit-appearance: none; appearance: none;
}
select.input {
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px;
  background-size: 5px 5px; background-repeat: no-repeat;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
input[type="date"].input { min-height: 48px; }
.input::placeholder { color: var(--text-3); opacity: 1; }
.input:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.input:disabled { opacity: .6; }
.hint { font-size: 13px; color: var(--text-2); }
.error-text { color: var(--warn); font-size: 14px; min-height: 0; }
.error-text:empty { display: none; }
.search { position: relative; }
.search > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-2); pointer-events: none; }
.search .input { padding-left: 42px; border-radius: 999px; }
.search-row { display: flex; gap: 8px; align-items: stretch; }
.scan-btn { min-height: 48px; }
.check { display: flex; gap: 12px; align-items: flex-start; min-height: var(--tap); padding: 4px 0; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent-text); flex: none; }
.check.boxed { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.check.member { align-items: center; color: var(--text); font-size: 15px; }
.check b { color: var(--text); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 52px; }
.pw-toggle { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
details.more { border-top: 1px solid var(--line); padding-top: 4px; }
details.more summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; color: var(--text-2); font-size: 14px; font-weight: 500; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 6px; background: var(--surface-2); }
details.more[open] summary::before { content: "−"; }
.grid-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.code-input { text-transform: uppercase; letter-spacing: .12em; font-weight: 600; }

/* ---------- карточки и блоки ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-title { margin-bottom: 12px; font-size: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.legal-draft { display: inline-block; max-width: 100%; height: auto; white-space: normal; overflow-wrap: anywhere; line-height: 1.4; border-radius: 14px; }
.chip.ok { background: var(--accent-soft); color: var(--accent-text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--surface-3); color: var(--accent-text); font-weight: 700; font-size: 15px; letter-spacing: 0; }
.avatar svg { width: 20px; height: 20px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; }
.empty { padding: 32px 20px; text-align: center; color: var(--text-2); display: grid; gap: 8px; justify-items: center; }
.empty h3, .empty .h3 { color: var(--text); }
.empty p { max-width: 440px; }
.empty .btn { margin-top: 8px; }
.empty-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.empty-icon svg { width: 22px; height: 22px; }
.empty-inline { padding: 16px 4px; }
.error-state { max-width: 520px; margin: 8vh auto 0; }
.banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid var(--accent-border); }
.banner > span { flex: 1 1 220px; }

.loading { min-height: 160px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text-2); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--accent-text); animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton-wrap { display: grid; gap: 12px; }
.skeleton { border-radius: var(--r-lg); background: linear-gradient(90deg, var(--skeleton) 0%, var(--skeleton-hi) 40%, var(--skeleton) 80%); background-size: 300% 100%; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- плитки ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { display: grid; gap: 4px; align-content: start; min-width: 0; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-align: left; text-decoration: none; }
.tile > span { font-size: 13px; color: var(--text-2); }
.tile > b { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tile > small { font-size: 13px; color: var(--text-2); }
.tile .bar { margin: 4px 0 2px; }
.tile-btn { cursor: pointer; font: inherit; }
.tile-btn:hover { border-color: var(--line-strong); text-decoration: none; }
.tile.warn > b { color: var(--warn); }

/* ---------- быстрые действия ---------- */
.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.quick-action {
  display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 60px; padding: 10px 12px;
  border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface);
  text-align: left; color: var(--text); touch-action: manipulation;
}
.quick-action:hover { border-color: var(--accent-border); }
.quick-action:active { transform: scale(.98); }
.quick-action > span:last-child { display: grid; min-width: 0; }
.quick-action b { font-size: 15px; font-weight: 600; line-height: 1.2; }
.quick-action small { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-ico { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.quick-ico svg { width: 20px; height: 20px; }

/* ---------- кольцо и полосы КБЖУ ---------- */
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .bg { stroke: var(--track); }
.ring .fg { stroke: var(--accent-text); stroke-linecap: round; transition: stroke-dashoffset .7s cubic-bezier(.2, .8, .2, 1); }
.ring .center { position: absolute; text-align: center; line-height: 1.1; }
.ring .center b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.ring .center span { font-size: 12px; color: var(--text-2); }
.kcal-card { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.kcal-big { margin-top: 4px; font-size: clamp(32px, 7vw, 42px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kcal-big small { font-size: 16px; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.kcal-left { margin-top: 6px; font-size: 14px; color: var(--accent-text); font-weight: 600; }
.kcal-left.over { color: var(--warn); }
.macros { display: grid; gap: 12px; margin-top: 16px; }
.macro { display: grid; gap: 6px; }
.macro-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.macro-top b { font-weight: 600; }
.macro-top span { color: var(--text-2); font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--accent-text); width: 0; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.macro.protein .bar > i { background: var(--protein); }
.macro.fat .bar > i { background: var(--fat); }
.macro.carbs .bar > i { background: var(--carbs); }
.bar.over > i { background: var(--warn) !important; }
.mini-bars { display: grid; gap: 4px; width: 100%; max-width: 180px; }
.mini-bars .bar { height: 5px; }

/* ---------- лента дней ---------- */
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 0 0 16px; }
.day {
  display: grid; justify-items: center; gap: 2px; min-width: 0; min-height: 62px; padding: 8px 0;
  border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); font-size: 13px; touch-action: manipulation;
}
.day b { font-size: 18px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.day.is-today { border-color: var(--accent-border); }
.day[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.day[aria-pressed="true"] b { color: var(--primary-ink); }

/* ---------- сегменты и вкладки ---------- */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); max-width: 100%; }
.segmented button { min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--text-2); font-weight: 600; font-size: 14px; touch-action: manipulation; }
.segmented button[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); }
.segmented button:disabled { opacity: .4; }
.tabs { display: flex; gap: 6px; margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; scroll-snap-align: start; min-height: var(--tap); padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 15px; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

/* ---------- списки ---------- */
.list { display: grid; gap: 8px; }
.list-tools { margin-bottom: 12px; }
.list-item { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.list-item:hover { border-color: var(--line-strong); text-decoration: none; }
.list-item.attention { border-left: 3px solid var(--warn); }
.list-item .title { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.list-item .title .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .sub { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .end { display: grid; gap: 2px; justify-items: end; text-align: right; font-size: 13px; color: var(--text-2); flex: none; }
.list-item .end b { color: var(--text); font-size: 15px; }
.list-item svg.chev { width: 18px; height: 18px; color: var(--text-3); flex: none; }

/* ---------- дневник питания ---------- */
.date-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.date-nav .label { flex: 1; text-align: center; font-weight: 700; font-size: 17px; }
.meals { padding-top: 6px; padding-bottom: 6px; }
.meal { padding: 14px 0; border-top: 1px solid var(--line); }
.meal:first-child { border-top: 0; }
.meal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.meal-items { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.meal-items li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 10px; align-items: center; padding: 6px 0; }
.meal-name { min-width: 0; }
.meal-name > div:first-child { font-weight: 500; overflow-wrap: anywhere; }
.macros-line { color: var(--text-2); font-size: 13px; }
.meal-kcal { color: var(--text-2); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.results { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); max-height: min(300px, 40vh); overflow-y: auto; overscroll-behavior: contain; }
.results button { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 52px; gap: 12px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; }
.results button svg { width: 18px; height: 18px; color: var(--accent-text); }
.results li:last-child button { border-bottom: 0; }
.results button:focus-visible { background: var(--surface-2); }
@media (hover: hover) { .results button:hover { background: var(--surface-2); } }
.r-name { min-width: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chosen { padding: 12px 14px; border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid var(--accent-border); display: grid; gap: 4px; }
.chosen-name { font-weight: 600; }
.chosen-macros { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; font-size: 14px; color: var(--text-2); }
.chosen-macros b { color: var(--text); font-size: 16px; }

/* ---------- тренировки ---------- */
.workout { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: grid; gap: 12px; min-width: 0; }
.workout.done { border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); }
.workout-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.workout-notes { font-size: 14px; color: var(--text-2); white-space: pre-wrap; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.workout-comment { font-size: 14px; color: var(--text-2); }
.workout-comment b { color: var(--text); }
.workout-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ex-list { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--line); }
.ex-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.ex-list li:last-child { border-bottom: 0; }
.ex-check { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; }
.ex-list li.done .ex-check { background: var(--accent-soft); border-color: var(--accent-text); color: var(--accent-text); }
.ex-check svg { width: 14px; height: 14px; }
.ex-name { font-weight: 500; overflow-wrap: anywhere; }
.ex-plan { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ex-fact { display: grid; justify-items: end; text-align: right; flex: none; }
.ex-fact b { font-size: 14px; font-variant-numeric: tabular-nums; }
.today-workout { display: flex; align-items: center; gap: 14px; }
.today-workout .ico { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.today-workout .ico svg { width: 22px; height: 22px; }
.sub-title { font-size: 15px; color: var(--text-2); font-weight: 600; }
.builder { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.builder-row { padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); display: grid; gap: 10px; }
.b-top { display: flex; gap: 10px; align-items: flex-end; }
.b-top .field { flex: 1; }
.b-num { width: 28px; height: 28px; flex: none; margin-bottom: 10px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: 13px; font-weight: 700; color: var(--text-2); }
.b-top .icon-btn { margin-bottom: 2px; }
.b-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.b-fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.complete-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.complete-list li { padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); display: grid; gap: 8px; }

/* ---------- календарь ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.day-col { display: flex; flex-direction: column; gap: 6px; min-height: 260px; padding: 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.day-col.today { border-color: var(--accent-border); box-shadow: inset 0 0 0 1px var(--accent-border); }
.day-col.drop { outline: 2px dashed var(--accent-text); outline-offset: -4px; }
.day-col header { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--text-2); margin-bottom: 4px; text-transform: capitalize; }
.day-col header b { color: var(--text); font-size: 18px; }
.cal-item { display: flex; align-items: center; gap: 2px; border-radius: var(--r-sm); background: var(--surface-2); border-left: 3px solid var(--accent-text); min-width: 0; }
.cal-item[draggable="true"] { cursor: grab; }
/* статус показываем цветом полосы и подписью, а не прозрачностью — иначе текст теряет контраст */
.cal-item.done { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok) 7%, var(--surface-2)); }
.cal-item.skipped { border-left-color: var(--warn); }
.cal-open { flex: 1; min-width: 0; display: grid; gap: 1px; padding: 8px 6px 8px 10px; border: 0; background: none; text-align: left; font-size: 14px; color: var(--text); }
.cal-open b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-open span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: 13px; }
.cal-item .icon-btn { width: 40px; height: 40px; }
@media (hover: hover) and (pointer: fine) { .cal-item .icon-btn { width: 32px; height: 32px; } .cal-item .icon-btn svg { width: 18px; height: 18px; } }
.add-day { align-self: stretch; }
.week-nav { display: flex; align-items: center; gap: 6px; }
.agenda { display: grid; gap: 10px; margin-bottom: 12px; }
.agenda-day { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 10px; }
.agenda-day.today { border-color: var(--accent-border); }
.agenda-day header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.agenda-day h2 { font-size: 16px; }

/* ---------- чат ---------- */
.chat { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100dvh - 170px); min-height: 460px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.conv-list { border-right: 1px solid var(--line); overflow-y: auto; padding: 8px; display: grid; align-content: start; gap: 2px; overscroll-behavior: contain; }
.conv { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px; border-radius: var(--r-md); color: var(--text); text-decoration: none; }
.conv[aria-current="page"] { background: var(--surface-2); }
@media (hover: hover) { .conv:hover { background: var(--surface-2); text-decoration: none; } }
.conv .grow { min-width: 0; }
.conv .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.conv-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .last { font-size: 14px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thread-head { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.thread-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-btn { display: none; }
.messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: min(560px, 82%); align-self: flex-start; padding: 9px 13px; border-radius: 18px 18px 18px 6px; background: var(--surface-2); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.msg.mine { align-self: flex-end; background: var(--bubble); color: var(--bubble-ink); border-radius: 18px 18px 6px 18px; }
:root[data-theme="light"] .msg.mine { box-shadow: inset 0 0 0 1px var(--accent-border); }
.msg .who { font-size: 13px; font-weight: 600; color: var(--accent-text); margin-bottom: 2px; }
.msg time { display: block; margin-top: 3px; font-size: 12px; opacity: .72; text-align: right; }
.msg .attach { display: flex; align-items: center; gap: 8px; margin-top: 6px; max-width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; }
/* место под фото резервируется заранее (4:5) — сообщения не «прыгают», когда фото догружается */
.msg .attach.photo { display: block; width: min(260px, 100%); aspect-ratio: 4 / 5; max-height: 46vh; border-radius: 12px; overflow: hidden; background: var(--surface-3); }
.msg .attach.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.msg .attach.doc { min-height: var(--tap); text-decoration: underline; }
.msg .attach.doc svg { width: 20px; height: 20px; flex: none; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--surface); }
.composer textarea { flex: 1; min-width: 0; min-height: var(--tap); max-height: 140px; padding: 10px 16px; border-radius: 22px; resize: none; line-height: 1.4; }
.composer .send { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.composer .send:disabled { opacity: .35; }
.read-only { padding: 14px 16px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 14px; text-align: center; }
.sheet-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sheet-grid button { display: grid; justify-items: center; gap: 8px; min-height: 96px; padding: 14px 6px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); font-size: 14px; text-align: center; }
.sheet-grid button > span { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.sheet-grid svg { width: 22px; height: 22px; }

/* ---------- фото прогресса ---------- */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.file { margin: 0; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; }
.file .preview { aspect-ratio: 3 / 4; width: 100%; padding: 0; border: 0; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); font-weight: 700; }
.file .preview img { width: 100%; height: 100%; object-fit: cover; }
.file .meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 4px 4px 12px; font-size: 14px; color: var(--text-2); }
.lightbox { display: grid; place-items: center; background: var(--surface-2); border-radius: var(--r-md); overflow: hidden; }
.lightbox img { max-width: 100%; max-height: min(70vh, 720px); object-fit: contain; display: block; }

/* ---------- графики ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--text-2); font-size: 12px; font-family: var(--font); }
.chart .line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .12; }
.chart .col { fill: var(--accent-text); opacity: .85; }
.chart .goal { stroke: var(--text-3); stroke-dasharray: 5 5; stroke-width: 1.5; }
.chart-wrap { margin-top: 18px; }
.chart-empty { padding: 28px 12px; text-align: center; color: var(--text-2); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; align-items: start; }
.side-col { padding-top: 62px; }

/* ---------- тарифы ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.plan { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.plan.current { border-color: var(--accent-text); }
.plan .price { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.plan .price small { font-size: 14px; color: var(--text-2); font-weight: 500; }
.plan ul { margin: 0; padding-left: 18px; color: var(--text-2); display: grid; gap: 4px; }
.plan .btn { margin-top: auto; }

/* ---------- профиль / настройки ---------- */
.profile-card { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.profile-card > div:last-child { min-width: 0; display: grid; gap: 4px; justify-items: start; }
.profile-card h2 { font-size: 20px; overflow-wrap: anywhere; }
.profile-card .muted { overflow-wrap: anywhere; }
.settings-groups { gap: 22px; }
.settings-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 4px 8px; letter-spacing: .01em; }
.settings { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.setting {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 12px 16px;
  border: 0; background: transparent; color: var(--text); text-align: left; text-decoration: none; font-size: 16px;
  cursor: pointer; touch-action: manipulation;
}
div.setting { cursor: default; }
.setting + .setting { border-top: 1px solid var(--line); }
@media (hover: hover) { .setting:hover { background: var(--surface-2); text-decoration: none; } div.setting:hover { background: transparent; } }
.setting .grow { min-width: 0; }
.setting-title { font-weight: 500; overflow-wrap: anywhere; }
.setting .muted { overflow-wrap: anywhere; }
.setting .ico { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent-text); }
.setting .ico svg, .setting svg.chev { width: 18px; height: 18px; }
.setting svg.chev { color: var(--text-3); flex: none; }
.setting.danger .setting-title, .setting.danger .ico { color: var(--warn); }
.legal-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 20px; font-size: 14px; }
.legal-links a { display: inline-flex; align-items: center; min-height: var(--tap); }

/* переключатель-«ползунок»: сам checkbox растянут на всю площадь — тап по нему всегда попадает */
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: var(--track); border: 1px solid var(--line-strong); transition: background-color .2s, border-color .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch input:checked + i { background: var(--accent-text); border-color: var(--accent-text); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + i { opacity: .45; }

/* ---------- вход и регистрация ---------- */
main.auth { max-width: none; padding: 0; }
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, 520px); }
/* левая половина — всегда тёмная фотография, независимо от темы: цвета заданы явно */
.auth-hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  padding: calc(clamp(24px, 4vw, 56px) + var(--safe-t)) clamp(24px, 4vw, 56px) clamp(24px, 4vw, 56px);
  background: #050908; color: #F2F7F6;
}
/* фото-слайдшоу (js/hero.js): кадры лежат стопкой, новый проявляется поверх старого,
   поэтому в середине смены нет «провала» в темноту; приближение — только transform */
.hero-slides {
  position: absolute; z-index: -2; inset: 0 0 0 auto; width: min(60%, 760px); background: #050908; opacity: 0; transition: opacity .9s ease;
  /* левый край фото растворяется в фоне — без видимого шва */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 32%); mask-image: linear-gradient(90deg, transparent 0, #000 32%);
}
.hero-slides.is-ready { opacity: 1; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s cubic-bezier(.4, 0, .2, 1); }
.hero-slide img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--fx, 50%) var(--fy, 35%); transform-origin: var(--fx, 50%) var(--fy, 35%); transform: scale(1.02); backface-visibility: hidden; user-select: none; -webkit-user-drag: none; }
.hero-slide.is-active { opacity: 1; z-index: 2; }
.hero-slide.is-leaving { opacity: 1; z-index: 1; transition: none; }
.hero-slide.is-active img, .hero-slide.is-leaving img { animation: hero-zoom calc(var(--hero-interval, 6500ms) + 3200ms) linear forwards; will-change: transform; }
.hero-slides.is-paused .hero-slide img { animation-play-state: paused; }
@keyframes hero-zoom { from { transform: scale(1.02); } to { transform: scale(1.1); } }

.hero-controls { position: absolute; z-index: 2; right: clamp(24px, 4vw, 56px); bottom: clamp(24px, 4vw, 56px); display: flex; align-items: center; gap: 12px; }
.hero-progress { display: flex; gap: 6px; }
.hero-progress i { position: relative; width: 22px; height: 3px; border-radius: 2px; overflow: hidden; background: rgba(242, 247, 246, .28); }
.hero-progress i.done { background: rgba(242, 247, 246, .8); }
.hero-progress i.run::after { content: ""; position: absolute; inset: 0; background: #CBFEF7; transform-origin: left center; animation: hero-fill var(--hero-interval, 6500ms) linear forwards; }
.hero-progress.is-paused i.run::after { animation-play-state: paused; }
@keyframes hero-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hero-pause { width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 1px solid rgba(242, 247, 246, .22); background: rgba(5, 9, 8, .55); color: #F2F7F6; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); touch-action: manipulation; cursor: pointer; }
.hero-pause svg { width: 18px; height: 18px; }
.hero-pause:focus-visible { outline: 2px solid #CBFEF7; outline-offset: 3px; }
@media (hover: hover) { .hero-pause:hover { background: rgba(5, 9, 8, .8); border-color: rgba(242, 247, 246, .45); } }
@media (prefers-reduced-motion: reduce) {
  .hero-slide, .hero-slides { transition: none; }
  .hero-slide img { animation: none !important; transform: none; }
  .hero-controls { display: none; }
}
.auth-shade { position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, rgba(5, 9, 8, .9) 0%, rgba(5, 9, 8, .55) 38%, rgba(5, 9, 8, .05) 72%, rgba(5, 9, 8, .3) 100%), linear-gradient(0deg, rgba(5, 9, 8, .85) 0%, transparent 34%); }
/* на широких экранах фото-колонка всегда ровно в высоту окна и не уезжает при прокрутке длинной формы */
@media (min-width: 861px) { .auth-hero { position: sticky; top: 0; height: 100vh; height: 100dvh; align-self: start; } }
.auth-hero .brand { padding: 0; color: #F2F7F6; align-self: flex-start; }
.auth-footnote { align-self: flex-start; }
.auth-hero .brand-mark { background: rgba(203, 254, 247, .1); color: #CBFEF7; border-color: rgba(203, 254, 247, .3); }
.auth-copy { max-width: 560px; }
.auth-kicker { display: inline-flex; padding: 7px 12px; margin-bottom: 20px; border-radius: 999px; border: 1px solid rgba(203, 254, 247, .3); background: rgba(203, 254, 247, .08); color: #CBFEF7; font-size: 13px; font-weight: 600; }
.auth-title { font-size: clamp(46px, 6.2vw, 84px); line-height: .98; letter-spacing: -0.05em; font-weight: 800; color: #F2F7F6; }
.auth-title em { font-style: normal; color: #CBFEF7; }
.auth-lead { max-width: 440px; margin-top: 18px; font-size: clamp(16px, 1.4vw, 19px); color: #B9C4C2; }
.auth-proof { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.auth-proof li { padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(242, 247, 246, .14); background: rgba(5, 9, 8, .6); color: #B9C4C2; font-size: 13px; }
.auth-proof b { color: #F2F7F6; font-weight: 600; }
.auth-footnote { color: #8D9A98; font-size: 13px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: calc(clamp(24px, 4vw, 52px) + var(--safe-t)) clamp(20px, 4vw, 52px) calc(clamp(24px, 4vw, 52px) + var(--safe-b)); background: var(--bg); }
.auth-card { width: 100%; max-width: 420px; display: grid; gap: 20px; }
.auth-card h1 { font-size: 30px; }
.auth-card > div > p { margin-top: 6px; }
.auth-roles { display: grid; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.role-pick { gap: 10px; }
.role-card {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 14px 16px;
  border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface);
  color: var(--text); text-align: left; text-decoration: none;
}
.role-card:hover { border-color: var(--accent-border); text-decoration: none; }
.role-card[aria-pressed="true"] { border-color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-text); }
.role-card .ico { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.role-card .ico svg { width: 22px; height: 22px; }
.role-card > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.role-card b { font-size: 16px; }
.role-card span { font-size: 14px; color: var(--text-2); }
.role-card svg.chev { width: 20px; height: 20px; color: var(--text-3); flex: none; }
.role-card[aria-pressed="true"] svg.chev { color: var(--accent-text); }

/* ---------- уведомления, приглашения ---------- */
.notif { display: flex; gap: 12px; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; }
a.notif:hover { border-color: var(--line-strong); text-decoration: none; }
.notif.unread { border-color: var(--accent-border); background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
.notif .ico { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.notif .ico svg { width: 20px; height: 20px; }
.notif time { display: block; margin-top: 2px; font-size: 13px; color: var(--text-2); }
.consent-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); }
.code-box { padding: 12px; border-radius: var(--r-md); background: var(--surface-2); text-align: center; font-size: 28px; font-weight: 800; letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.qr { width: min(240px, 66vw); margin: 0 auto; padding: 14px; border-radius: var(--r-md); background: #FFFFFF; }
.qr svg { display: block; width: 100%; height: auto; }
.confirm-text { font-size: 16px; }

/* ---------- сканер штрих-кодов ---------- */
.scanner-view { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; background: #000000; }
.scanner-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-frame { position: absolute; inset: 25% 6%; border: 2px solid #CBFEF7; border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .45); }
.scanner-frame::after { content: ""; position: absolute; left: 10px; right: 10px; top: 50%; height: 2px; background: #CBFEF7; animation: scan-line 1.6s ease-in-out infinite alternate; }
@keyframes scan-line { from { transform: translateY(-40px); } to { transform: translateY(40px); } }
.scanner-status { min-height: 1.5em; }

/* ---------- модальные окна ---------- */
dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  overflow: hidden;
}
dialog.wide { width: min(720px, calc(100vw - 32px)); }
dialog[open] { display: flex; animation: dlg-in .18s ease-out; }
dialog::backdrop { background: var(--overlay); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal { display: flex; flex-direction: column; width: 100%; min-height: 0; max-height: inherit; }
.sheet-handle { display: none; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 12px 8px 20px; }
.modal-head h2 { font-size: 19px; }
.modal-head h2:focus { outline: none; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 20px 20px; -webkit-overflow-scrolling: touch; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 12px 20px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.modal-foot .btn[aria-busy="true"] { cursor: wait; }
/* прокрутка страницы под открытым окном выключена (на iOS — через position:fixed) */
html.modal-open, html.modal-open body { overflow: hidden; }
html.modal-open body { position: fixed; left: 0; right: var(--fc-scrollbar-width, 0px); }

/* ---------- всплывающие сообщения ---------- */
#toast { position: fixed; z-index: 300; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(480px, calc(100vw - 24px)); display: grid; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 18px; border-radius: 16px; background: var(--text); color: var(--bg); font-weight: 500; font-size: 15px; box-shadow: var(--shadow); animation: toast-in .2s ease-out; }
.toast > span { flex: 1; }
.toast.error { background: var(--warn); color: #FFFFFF; }
:root[data-theme="dark"] .toast.error, :root:not([data-theme]) .toast.error { color: #1A0705; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
.toast-action { min-height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--bg) 18%, transparent); color: inherit; font-weight: 700; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ==========================================================================
   Телефон и планшет (≤ 860 px)
   ========================================================================== */
@media (max-width: 860px) {
  :root { --tabbar-h: 60px; }
  .shell { display: block; min-height: 100dvh; }
  main { padding: calc(14px + var(--safe-t)) 16px calc(var(--tabbar-h) + 28px + var(--safe-b)); }
  h1 { font-size: 28px; }

  /* нижнее меню */
  .rail {
    position: fixed; z-index: 50; inset: auto 0 0 0; height: auto; top: auto;
    flex-direction: row; justify-content: space-around; gap: 0;
    padding: 4px max(4px, env(safe-area-inset-right, 0px)) calc(4px + var(--safe-b)) max(4px, env(safe-area-inset-left, 0px));
    border-right: 0; border-top: 1px solid var(--line);
    background: var(--tabbar-bg);
    -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
  }
  .rail .brand, .rail-foot { display: none; }
  .nav-link { flex: 1 1 0; min-width: 0; min-height: 52px; flex-direction: column; justify-content: center; gap: 3px; padding: 4px 2px; border-radius: 12px; font-size: 12px; font-weight: 500; background: none !important; }
  .nav-link svg { width: 24px; height: 24px; }
  .nav-link .nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-link[aria-current="page"] { color: var(--accent-text); }
  .nav-link .badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; }
  #toast { bottom: calc(var(--tabbar-h) + 14px + var(--safe-b)); }
  body[data-route="auth"] #toast { bottom: calc(16px + var(--safe-b)); }

  .page-head { margin-bottom: 16px; }
  .head-actions .btn { padding: 0 16px; }
  .person-head { display: grid; gap: 14px; }
  .person-head .head-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .person { display: flex; align-items: center; gap: 14px; min-width: 0; }
  .person h1 { font-size: 24px; overflow-wrap: anywhere; }
  .avatar.lg { width: 56px; height: 56px; font-size: 20px; }
  .back { margin-top: -6px; }
  .side-col { padding-top: 0; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 16px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile > b { font-size: 22px; }
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .toolbar { align-items: stretch; }
  .toolbar .segmented { flex: 1 1 auto; }
  .toolbar .segmented button { flex: 1 1 auto; }
  .segmented button { min-height: 40px; }
  .grid-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .list-item .end { display: none; }

  /* чат: список чатов и открытый чат — разные «экраны», как в мессенджерах */
  .chat { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; border: 0; background: none; border-radius: 0; overflow: visible; }
  .chat.has-peer .conv-list { display: none; }
  .chat:not(.has-peer) .thread { display: none; }
  .conv-list { border: 0; padding: 0; gap: 6px; overflow: visible; }
  .conv { background: var(--surface); border: 1px solid var(--line); }
  .back-btn { display: inline-grid; margin-left: -8px; }
  .mobile-thread-page { margin: calc(-14px - var(--safe-t)) -16px 0; }
  .mobile-thread-page .chat { display: block; }
  /* открытый чат — отдельный полноэкранный экран (как в мессенджерах): нижнее меню скрыто,
     окно переписки закреплено ровно по видимой области — и с клавиатурой, и без неё */
  .mobile-thread-page .thread {
    position: fixed; left: 0; right: 0; top: var(--vvt, 0px); z-index: 20;
    height: var(--vvh);
    background: var(--bg);
  }
  body:has(.mobile-thread-page) .rail { display: none; }
  html:has(.mobile-thread-page), html:has(.mobile-thread-page) body { overflow: hidden; overscroll-behavior: none; }
  .mobile-thread-page .messages { overscroll-behavior: contain; }
  .mobile-thread-page .thread-head { padding: calc(6px + var(--safe-t)) 10px 6px; background: var(--tabbar-bg); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
  .mobile-thread-page .messages { padding: 12px; }
  .mobile-thread-page .composer { padding: 8px 10px; background: var(--tabbar-bg); }
  /* клавиатура открыта: нижнее меню и нижние панели прячем — место отдаём полю ввода;
     нижние окна-листы поднимаем над клавиатурой и ограничиваем видимой областью */
  html.kb-open .rail, html.kb-open .ss-bottom { display: none; }
  html.kb-open dialog, html.kb-open dialog.wide { margin-bottom: var(--kb, 0px); max-height: calc(var(--vvh) - 8px); }
  html.kb-open .modal-foot { padding-bottom: 10px; }
  /* над клавиатурой места мало: «Отмена» прячем (есть крестик), главная кнопка — одной строкой;
     в листе «Добавить еду» выбор приёма пищи возвращается, когда клавиатура закрыта */
  html.kb-open .modal-foot .btn:not(.primary) { display: none; }
  html.kb-open .sheet-handle, html.kb-open .fp-meals { display: none; }
  html.kb-open #toast { bottom: calc(var(--kb, 0px) + 12px); }
  html.kb-open #toast.over-dialog { top: calc(8px + var(--vvt, 0px)); bottom: auto; }
  main:has(> .mobile-thread-page) { padding-bottom: 0; }
  .msg { max-width: 86%; }
  .msg .attach.photo { width: min(64vw, 260px); }
  .sheet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* модальные окна — лист снизу */
  dialog, dialog.wide {
    width: 100%; max-width: 100%;
    max-height: calc(var(--vvh) - 12px - var(--safe-t));
    margin: auto 0 0; border-radius: 22px 22px 0 0; border-bottom: 0;
  }
  dialog[open] { animation: sheet-in .22s cubic-bezier(.2, .8, .2, 1); }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: .6; } }
  .sheet-handle { display: block; width: 40px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: var(--line-strong); flex: none; }
  .modal-head { padding: 8px 8px 4px 18px; }
  .modal-body { padding: 8px 18px 18px; }
  .modal-foot { padding: 10px 16px calc(12px + var(--safe-b)); }
  .modal-foot .btn { flex: 1 1 0; }

  /* вход: фото-шапка компактная, форма видна без прокрутки */
  .auth { display: block; }
  .auth-hero { min-height: clamp(300px, 44svh, 440px); gap: 16px; padding: calc(18px + var(--safe-t)) 20px 22px; }
  .hero-slides { width: 84%; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24%); mask-image: linear-gradient(90deg, transparent 0, #000 24%); }
  .hero-controls { top: calc(14px + var(--safe-t)); right: 14px; bottom: auto; gap: 10px; }
  .hero-progress { gap: 5px; }
  .hero-progress i { width: 14px; }
  .auth-shade { background: linear-gradient(90deg, rgba(5, 9, 8, .92) 0%, rgba(5, 9, 8, .7) 40%, rgba(5, 9, 8, .12) 100%), linear-gradient(0deg, #050908 0%, rgba(5, 9, 8, .4) 30%, transparent 55%); }
  .auth-title { font-size: clamp(38px, 11vw, 56px); }
  .auth-kicker { margin-bottom: 14px; font-size: 12px; }
  .auth-lead { font-size: 15px; max-width: 300px; margin-top: 12px; }
  .auth-proof, .auth-footnote { display: none; }
  .auth-form { align-items: flex-start; padding: 22px 20px calc(28px + var(--safe-b)); }
  .auth-card { max-width: none; }
  .auth-card h1 { font-size: 26px; }
}

@media (max-width: 420px) {
  main { padding-left: 14px; padding-right: 14px; }
  .mobile-thread-page { margin-left: -14px; margin-right: -14px; }
  .days { gap: 4px; }
  .day { min-height: 58px; font-size: 12px; }
  .day b { font-size: 17px; }
  .kcal-card { gap: 10px; }
  .ring { width: 84px !important; height: 84px !important; }
  .ring svg { width: 84px; height: 84px; }
  .meal-items li { grid-template-columns: minmax(0, 1fr) auto; }
  .meal-items li .meal-kcal { grid-row: 1; grid-column: 2; }
  .meal-items li .del { grid-row: 1 / span 2; grid-column: 3; }
  .b-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .search-row .scan-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .search-row .scan-btn { width: 48px; padding: 0; }
  .head-actions .btn > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .head-actions .btn { width: var(--tap); padding: 0; }
  .person-head .head-actions .btn > span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .person-head .head-actions .btn { width: auto; padding: 0 14px; }
}

@media (max-width: 389px) { .nav-link { font-size: 11px; } }   /* узкие телефоны: «Подопечные», «Календарь» целиком */
@media (max-width: 340px) { .nav-link { letter-spacing: -0.02em; padding-left: 0; padding-right: 0; } }
@media (max-width: 360px) {
  .quick-action { padding: 10px; gap: 8px; }
  .quick-ico { width: 34px; height: 34px; }
  .quick-action small { display: none; }
  .tile > b { font-size: 20px; }
  .tabs button { padding: 0 14px; }
}

@media (max-width: 360px) { .hero-progress { display: none; } }

/* альбомная ориентация телефона: экономим высоту */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 860px) {
  .auth-hero { display: none; }
}
/* телефон боком (большие модели шире 860px): фото с заголовком слева, форма справа */
@media (orientation: landscape) and (max-height: 520px) and (min-width: 861px) {
  .auth { grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); }
  .auth-hero { padding: calc(16px + var(--safe-t)) 24px 20px calc(24px + env(safe-area-inset-left, 0px)); }
  .auth-kicker, .auth-lead, .auth-proof, .auth-footnote { display: none; }
  .auth-title { font-size: clamp(34px, 5vw, 52px); }
  .auth-form { padding-right: calc(24px + env(safe-area-inset-right, 0px)); }
  .hero-controls { bottom: 16px; right: 16px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .mobile-thread-page .thread-head { min-height: 52px; }
}

@media (hover: hover) {
  .list-item:hover, .quick-action:hover { transform: translateY(-1px); }
}
@media (display-mode: standalone) {
  .nav-link, .btn, .tabs button, .segmented button, .day, .quick-action { -webkit-user-select: none; user-select: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .btn, .icon-btn, .tabs button, .segmented button, .day, .switch i { border: 1px solid ButtonText; }
}

/* ---------- тач-устройства: все цели не меньше 44×44 (Apple HIG, WCAG 2.5.5) ----------
   На десктопе с мышью компактные кнопки остаются компактными. */
@media (pointer: coarse) {
  .btn.sm, .segmented button { min-height: var(--tap); }
  .link-btn { min-width: var(--tap); justify-content: center; }
  .icon-btn, .cal-item .icon-btn { min-width: var(--tap); min-height: var(--tap); }
  .add-day { min-height: var(--tap); }
}

/* ссылки внутри текста отличаются не только цветом (WCAG 1.4.1) */
p a, .check a, .muted a, .hint a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* =====================================================================
   v6: аватарки, залы тренера, загрузчик «рука с гантелью», плавные переходы
   ===================================================================== */

/* ---------- аватарки ---------- */
.avatar { position: relative; overflow: hidden; isolation: isolate; }
.avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .28s ease; }
.avatar.has-photo > img { opacity: 1; }
.avatar.has-photo .avatar-ini { opacity: 0; transition: opacity .28s ease; }
.avatar.xl { width: 112px; height: 112px; font-size: 36px; }
.avatar-edit { position: relative; flex: none; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; touch-action: manipulation; }
.avatar-edit .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--line-strong); transition: box-shadow .2s ease; }
.avatar-edit-badge { position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); color: var(--primary-ink); box-shadow: 0 0 0 3px var(--bg); }
.avatar-edit-badge svg { width: 15px; height: 15px; }
.avatar-edit:focus-visible { outline: none; }
.avatar-edit:focus-visible .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-text); }
@media (hover: hover) { .avatar-edit:hover .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-border); } }

/* кадрирование */
.crop { justify-items: stretch; }
.crop-empty { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 8px 0; }
.crop-editor { display: grid; gap: 14px; justify-items: center; }
.crop-stage { position: relative; width: min(300px, 100%); aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: var(--surface-2);
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.crop-stage:active { cursor: grabbing; }
.crop-stage:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.crop-canvas { display: block; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 999px rgba(5, 9, 8, .5); outline: 2px solid rgba(255, 255, 255, .85); outline-offset: -2px; }
.crop-zoom-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; width: min(300px, 100%); }
.crop-zoom { width: 100%; accent-color: var(--accent-text); height: var(--tap); }
.crop-actions { justify-content: center; flex-wrap: wrap; }

/* ---------- залы тренера (Яндекс Карты) ---------- */
.gyms { display: grid; gap: 8px; min-width: 0; }
.gym { display: flex; align-items: center; gap: 12px; min-height: 60px; min-width: 0; padding: 10px 12px 10px 10px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s ease, background .15s ease; }
.gym-ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); }
.gym-ico svg { width: 21px; height: 21px; }
.gym-text { display: grid; gap: 2px; min-width: 0; }
.gym-text b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gym-text small { color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gym-go { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; color: var(--text-2); }
.gym-go small { font-size: 12px; }
.gym-go svg { width: 16px; height: 16px; }
.gym:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
@media (hover: hover) { .gym:hover { border-color: var(--accent-border); background: var(--surface-2); text-decoration: none; } .gym:hover .gym-go { color: var(--accent-text); } }
.gym.compact { display: inline-flex; min-height: 36px; padding: 4px 10px 4px 6px; gap: 8px; border-radius: 999px; max-width: 100%; }
.gym.compact .gym-ico { width: 26px; height: 26px; border-radius: 50%; }
.gym.compact .gym-ico svg { width: 15px; height: 15px; }
.gym.compact .gym-text b { font-size: 14px; }
.gym.compact .gym-go svg { width: 14px; height: 14px; }
.gyms:has(> .gym.compact) { display: flex; flex-wrap: wrap; gap: 6px; }
@media (pointer: coarse) { .gym.compact { min-height: var(--tap); } }
@media (max-width: 420px) { .gym-go small { display: none; } }
.gyms-block { display: grid; gap: 12px; justify-items: start; width: 100%; }
.gyms-block .gyms { width: 100%; }
.gyms-empty { margin: 0; }
.setting.gyms-setting, .setting.coach-setting { display: block; padding: 14px 16px; cursor: default; }
@media (hover: hover) { .setting.gyms-setting:hover, .setting.coach-setting:hover { background: transparent; } }
.gym-rows { gap: 12px; }
.gym-row { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); display: grid; gap: 12px; min-width: 0; }
.gym-row-head { display: flex; align-items: center; justify-content: space-between; margin: -4px -6px -4px 0; }
.join-gyms { display: grid; gap: 8px; width: 100%; text-align: left; margin-top: 4px; }

/* карточка тренера у спортсмена */
.coach-card { display: grid; gap: 12px; min-width: 0; }
.coach-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.coach-head .grow { display: grid; gap: 1px; min-width: 0; }
.coach-head b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coach-card.compact { gap: 10px; padding: 10px 12px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.coach-card.compact .coach-head b { font-size: 15px; }
/* залы в полосе на главной — одной строкой с прокруткой, полоса не растёт в высоту */
.coach-card.compact .gyms { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px; padding: 0 12px 2px; scrollbar-width: none; overscroll-behavior-x: contain; }
.coach-card.compact .gyms::-webkit-scrollbar { display: none; }
.coach-card.compact .gym.compact { flex: none; max-width: 80%; }

/* ---------- файлы: фото прогресса + вложения из чата ---------- */
.file { position: relative; }
.file .preview img { opacity: 0; transition: opacity .25s ease; }
.file .preview img.in { opacity: 1; }
.file .preview.doc { color: var(--text-2); }
.doc-ico { display: grid; justify-items: center; gap: 6px; }
.doc-ico svg { width: 34px; height: 34px; }
.doc-ico b { font-size: 12px; letter-spacing: .08em; }
.file-badge { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 6px; border-radius: 999px;
  background: rgba(5, 9, 8, .72); color: #F2F7F6; font-size: 12px; font-weight: 600; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); pointer-events: none; }
.file-badge svg { width: 13px; height: 13px; }
.file-meta { display: grid; gap: 1px; min-width: 0; }
.file-meta small { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta small.file-name { color: var(--text-2); }
.seg-count { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 12px; line-height: 18px; text-align: center; }
.segmented button[aria-pressed="true"] .seg-count { background: rgba(0, 0, 0, .18); color: inherit; }

/* ---------- плавные переходы между разделами ---------- */
#main { view-transition-name: page; }
::view-transition-old(page) { animation: vt-out .16s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(page) { animation: vt-in-fade .26s cubic-bezier(0, 0, .2, 1) both; }
:root[data-nav="push"]::view-transition-new(page) { animation-name: vt-in-push; }
:root[data-nav="pop"]::view-transition-new(page) { animation-name: vt-in-pop; }
::view-transition-group(page) { animation-duration: .26s; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in-fade { from { opacity: 0; transform: translateY(8px); } }
@keyframes vt-in-push { from { opacity: 0; transform: translateX(28px); } }
@keyframes vt-in-pop { from { opacity: 0; transform: translateX(-28px); } }
/* запасной вариант без View Transitions API */
.page-in-fade { animation: vt-in-fade .26s cubic-bezier(0, 0, .2, 1) both; }
.page-in-push { animation: vt-in-push .26s cubic-bezier(0, 0, .2, 1) both; }
.page-in-pop { animation: vt-in-pop .26s cubic-bezier(0, 0, .2, 1) both; }
/* повторная загрузка внутри страницы: старое тускнеет на месте, высота не прыгает */
.is-refreshing { opacity: .5; transition: opacity .2s ease; }
.swap-in { animation: swap-in .22s ease-out both; }
@keyframes swap-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(page), ::view-transition-new(page) { animation: none; }
  .page-in-fade, .page-in-push, .page-in-pop, .swap-in { animation: none; }
}

/* =====================================================================
   v7: выделенный пункт меню, проверка полей, загрузчик-персонажи, реакции
   и голосовые в чате, шаблоны, заметки, геолокация залов
   ===================================================================== */

/* ---------- фирменный бирюзовый для выделенного пункта меню ---------- */
:root { --brand-fill: #CBFEF7; --brand-ink: #06110F; --brand-ring: rgba(203, 254, 247, .38); }
:root[data-theme="light"] { --brand-fill: #0A7A6C; --brand-ink: #FFFFFF; --brand-ring: rgba(10, 122, 108, .35); }

/* «Мои подопечные» — первый пункт, всегда залит бирюзовым и стоит особняком */
.nav-link.nav-accent {
  margin-bottom: 10px; background: var(--brand-fill); color: var(--brand-ink); font-weight: 700;
  box-shadow: 0 6px 18px -8px var(--brand-ring);
}
.nav-link.nav-accent svg, .nav-link.nav-accent[aria-current="page"] svg { color: var(--brand-ink); }
.nav-link.nav-accent[aria-current="page"] { color: var(--brand-ink); background: var(--brand-fill); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--brand-ring); }
@media (hover: hover) { .nav-link.nav-accent:hover { color: var(--brand-ink); background: var(--brand-fill); filter: brightness(1.06); } }
.nav-link.nav-accent::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -6px; height: 1px; background: var(--line); }
.nav-link.nav-accent:focus-visible { outline-offset: 4px; }
.nav-short { display: none; }

/* ---------- проверка полей на лету ---------- */
.field-error { display: flex; align-items: flex-start; gap: 6px; margin: 0; color: var(--warn); font-size: 13px; font-weight: 500; line-height: 1.35; animation: fe-in .18s ease-out; }
.field-error::before { content: "!"; flex: none; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; background: var(--warn); color: var(--bg); font-size: 11px; font-weight: 800; }
@keyframes fe-in { from { opacity: 0; transform: translateY(-3px); } }
.field-suggest { justify-self: start; min-height: 32px; padding: 4px 12px; border-radius: 999px; border: 1px dashed var(--accent-border); background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 600; cursor: pointer; }
.field.is-invalid .input { border-color: var(--warn); }
.field.is-invalid .input:focus { box-shadow: 0 0 0 3px var(--warn-soft); }
.field.is-valid .input:not(:focus) { border-color: color-mix(in srgb, var(--ok) 55%, var(--line-strong)); }
.dev-code { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-md); border: 1px dashed var(--accent-border); background: var(--accent-soft); font-size: 14px; }
.dev-code svg { width: 18px; height: 18px; flex: none; color: var(--accent-text); }
.dev-code b { font-size: 17px; letter-spacing: .12em; font-variant-numeric: tabular-nums; color: var(--text); }
.dev-code a { color: var(--accent-text); font-weight: 600; overflow-wrap: anywhere; }
.phone-row { display: flex; gap: 10px; align-items: flex-end; }
.phone-row > .field { flex: 1 1 auto; min-width: 0; }
.phone-row > .btn { flex: none; min-height: 48px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; min-width: 0; }
.link-small { display: inline-flex; align-items: center; min-height: var(--tap); font-size: 14px; font-weight: 600; color: var(--accent-text); }
.segmented.block { display: flex; width: 100%; border-radius: var(--r-md); }
.segmented.block button { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; }
.segmented.block button svg { width: 18px; height: 18px; }
.banner.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.banner.error { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--text); }
.row.wrap { flex-wrap: wrap; align-items: center; gap: 8px; }
.info-row { cursor: default; }
.info-row .btn { flex: none; }

/* ---------- чат: реакции как на iPhone ---------- */
.chat { --chat-bg: var(--surface); }
.msg-row { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; max-width: 100%; }
.msg-row.mine { align-items: flex-end; }
.msg-line { display: flex; align-items: center; gap: 4px; min-width: 0; max-width: min(620px, 88%); }
.msg-row.mine .msg-line { flex-direction: row-reverse; }
.msg-line > .msg { max-width: 100%; align-self: auto; transition: transform .15s ease; -webkit-touch-callout: none; }
.msg.pressed { transform: scale(.96); }
.msg-react { flex: none; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-3);
  opacity: 0; transition: opacity .15s ease, background .15s ease, color .15s ease; cursor: pointer; }
.msg-react svg { width: 19px; height: 19px; }
.msg-row:hover .msg-react, .msg-react:focus-visible { opacity: 1; }
.msg-react:hover { background: var(--surface-2); color: var(--text); }
@media (hover: none) {
  /* на телефоне реакция — долгим нажатием, как в iMessage; кнопку слышат только скринридеры */
  .msg-react { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .msg-react:focus-visible { position: static; width: 32px; height: 32px; clip: auto; }
}
.rx:empty { display: none; }
.rx { position: relative; z-index: 1; margin: -9px 10px 0; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; }
.msg-row.mine .reactions { justify-content: flex-end; }
.reaction { display: inline-flex; align-items: center; gap: 3px; min-height: 28px; min-width: 32px; padding: 1px 8px; border-radius: 999px;
  border: 2px solid var(--chat-bg); background: var(--surface-3); color: var(--text); font-size: 15px; line-height: 1; cursor: pointer;
  animation: rx-pop .28s cubic-bezier(.2, 1.4, .4, 1) both; }
.reaction.mine { background: var(--brand-fill); color: var(--brand-ink); }
.r-emoji { font-size: 16px; line-height: 1; }
.r-n { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
@keyframes rx-pop { from { transform: scale(.4); opacity: 0; } }
.reaction-picker { position: fixed; z-index: 450; display: flex; align-items: center; flex-wrap: wrap; gap: 2px; max-width: min(352px, calc(100vw - 16px)); padding: 5px;
  border-radius: 26px; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(6px) scale(.9); transform-origin: 50% 100%; transition: opacity .16s ease, transform .2s cubic-bezier(.2, 1.2, .4, 1); }
.reaction-picker.in { opacity: 1; transform: none; }
.reaction-picker button { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; font-size: 24px; line-height: 1; cursor: pointer;
  transition: transform .12s ease, background .12s ease; }
.reaction-picker button:hover, .reaction-picker button:focus-visible { background: var(--surface-2); transform: scale(1.18); }
.reaction-picker button.on { background: var(--brand-fill); }
.reaction-picker button.more { color: var(--text-2); background: var(--surface-2); }
.reaction-picker button.more svg { width: 20px; height: 20px; }
.reaction-picker button:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 0; }

/* ---------- чат: голосовые ---------- */
.msg.has-voice { padding: 8px 10px 6px; }
.voice { display: flex; align-items: center; gap: 10px; width: min(300px, 62vw); min-width: 200px; white-space: normal; }
.vp-play { flex: none; width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--brand-fill); color: var(--brand-ink); cursor: pointer; touch-action: manipulation; }
.vp-play svg { width: 20px; height: 20px; fill: currentColor; }
.voice.mine .vp-play { background: var(--bubble-ink); color: var(--bubble); }
.voice.loading .vp-play { opacity: .6; cursor: progress; }
.vp-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.vp-wave { display: flex; align-items: center; gap: 2px; height: 30px; cursor: pointer; touch-action: manipulation; border-radius: 4px; }
.vp-wave i { flex: 1 1 0; min-width: 2px; max-width: 4px; border-radius: 2px; background: currentColor; opacity: .3; transition: opacity .12s linear; }
.vp-wave i.on { opacity: 1; }
.voice:not(.mine) .vp-wave i.on { background: var(--accent-text); }
.vp-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; }
.vp-time { font-variant-numeric: tabular-nums; opacity: .8; }
.vp-rate { min-width: 40px; min-height: 24px; padding: 0 8px; border: 0; border-radius: 999px; background: color-mix(in srgb, currentColor 14%, transparent); color: inherit;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; touch-action: manipulation; }
.voice.playing .vp-rate { background: color-mix(in srgb, currentColor 22%, transparent); }
@media (pointer: coarse) { .vp-rate { min-height: 32px; min-width: 48px; } }

/* запись голосового */
.composer.recording { align-items: center; }
.recorder { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: var(--tap); animation: fe-in .18s ease-out; }
.rec-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--warn); animation: rec-blink 1s ease-in-out infinite; }
@keyframes rec-blink { 50% { opacity: .25; } }
.rec-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.rec-limit { margin-left: -8px; color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rec-meter { flex: 1; min-width: 0; display: flex; align-items: center; gap: 3px; height: 30px; overflow: hidden; }
.rec-meter i { flex: 1 1 0; min-width: 2px; max-width: 5px; height: 100%; border-radius: 2px; background: var(--accent-text); transform: scaleY(.15); transition: transform .08s linear; }
.rec-cancel:hover { color: var(--warn); }
@media (max-width: 380px) { .rec-limit { display: none; } }

/* ---------- чат: карточка «поделились планом» ---------- */
.share-card { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 10px 10px 10px 8px; border-radius: 12px; white-space: normal;
  background: color-mix(in srgb, currentColor 8%, transparent); color: inherit; text-decoration: none; }
.share-card:hover { text-decoration: none; background: color-mix(in srgb, currentColor 13%, transparent); }
.share-card .ico { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-fill); color: var(--brand-ink); }
.msg.mine .share-card .ico { background: var(--bubble-ink); color: var(--bubble); }
.share-card .ico svg { width: 20px; height: 20px; }
.share-card .grow { display: grid; gap: 1px; min-width: 0; }
.share-card b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-card small { font-size: 12px; opacity: .78; }
.share-card .chev { width: 18px; height: 18px; flex: none; opacity: .6; }
.share-card.dead { opacity: .6; pointer-events: none; }

/* ---------- шаблоны и программы ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 12px; }
.tpl-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tpl-card h2 { overflow-wrap: anywhere; }
.tpl-card p { margin: 0; }
.tpl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tpl-tools { margin: -8px -8px 0 auto; display: flex; gap: 0; }
.chip.kind-plan { background: color-mix(in srgb, var(--carbs) 15%, transparent); color: var(--carbs); }
.tpl-ex { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; color: var(--text); }
.tpl-ex li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-ex li > span { color: var(--text-2); }
.tpl-actions { margin-top: auto; padding-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.plan-days { gap: 10px; }
.plan-day { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); padding: 0 14px; }
.plan-day[open] { padding-bottom: 14px; background: transparent; }
.plan-day summary { min-height: 52px; display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.plan-day summary::-webkit-details-marker { display: none; }
.plan-day summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg); transition: transform .15s ease; flex: none; }
.plan-day[open] summary::after { transform: rotate(-135deg); }
.plan-day-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.plan-day-sub { flex: none; }
.row > .field:has(.day-offset) { flex: 0 1 150px; }
.share-row { align-items: flex-end; flex-wrap: nowrap; }
.share-row > .field { flex: 1 1 auto; }
.share-row .input { font-size: 14px; }
@media (pointer: coarse) { .share-row .input { font-size: 16px; } } /* <16px — iOS увеличивает страницу при фокусе */
.share-row > .btn { min-height: 48px; }
.member-list { gap: 2px; max-height: min(280px, 40vh); overflow-y: auto; overscroll-behavior: contain; padding: 4px 2px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tpl-pick { max-height: 50vh; overflow-y: auto; }
.tpl-pick .list-item { min-height: 60px; width: 100%; text-align: left; }
.ex-list li.ex { display: grid; gap: 2px; }

/* ---------- личные заметки тренера ---------- */
.quick-note { display: grid; gap: 10px; margin-bottom: 14px; }
.quick-note textarea.input { min-height: 56px; resize: none; }
.notes-tools > .input { flex: 1 1 220px; width: auto; min-width: 0; }
.notes-tools > select.input { flex: 0 1 240px; }
.notes-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.notes-grid .fc-notes-date-group { display: grid; gap: 8px; min-width: 0; }
.notes-grid .fc-notes-date-group h2 { margin: 0; font-size: 17px; font-weight: 700; }
.fc-notes-month-rows { display: grid; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.note-card { display: grid; gap: 4px; width: 100%; min-width: 0; min-height: 62px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.note-card:last-child, .fc-notes-month-rows .fc-note-preview:last-child { border-bottom: 0; }
.note-card .fc-note-preview-heading { display: flex; align-items: center; gap: 8px; min-width: 0; }
.note-card .fc-note-preview-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; line-height: 1.35; }
.note-card:focus-visible, .fc-notes-month-rows .fc-note-preview:focus-visible { outline-offset: -3px; }
@media (hover: hover) { .note-card:hover { background: var(--surface-2); } }
.note-pin { display: inline-flex; align-items: center; flex: none; color: var(--accent-text); }
.note-pin svg { width: 16px; height: 16px; }
.note-meta, .fc-notes-month-rows .fc-note-preview-meta { display: flex; align-items: center; justify-content: flex-start; gap: 8px; min-width: 0; }
.note-time, .note-meta > small { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.note-meta > small { max-width: 34%; overflow: hidden; text-overflow: ellipsis; }
.fc-notes-month-rows .fc-note-preview-text { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text-2); }

/* ---------- геолокация залов ---------- */
.gym-geo { display: grid; gap: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }
.gym-with-route { display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.gym-with-route > .gym { flex: 1 1 auto; min-width: 0; }
.gym-route { flex: none; min-height: 60px; border-radius: var(--r-md); border-color: var(--line); }
.nearby-btn { justify-self: start; }

/* ---------- телефон: нижнее меню — максимум 5 пунктов ---------- */
@media (max-width: 860px) {
  .nav-link.desktop-only { display: none; }
  .nav-long { display: none; }
  .nav-short { display: inline; }
  /* выделенный пункт: бирюзовая «таблетка» под иконкой, как главное действие */
  .nav-link.nav-accent { margin: 0; background: none !important; box-shadow: none; color: var(--accent-text); filter: none; }
  .nav-link.nav-accent::after { display: none; }
  .nav-link.nav-accent svg { width: 44px; height: 28px; padding: 3px 11px; border-radius: 14px; background: var(--brand-fill); color: var(--brand-ink); box-sizing: border-box; }
  .nav-link.nav-accent[aria-current="page"] { color: var(--accent-text); box-shadow: none; }
  .nav-link.nav-accent[aria-current="page"] svg { color: var(--brand-ink); box-shadow: 0 0 0 2px var(--tabbar-bg), 0 0 0 4px var(--brand-ring); }
  .nav-link.nav-accent { flex-grow: 1.3; }      /* «Подопечные» жирным не обрезается даже на 360 px */
  .nav-link.nav-accent .nav-label { font-weight: 700; letter-spacing: -0.01em; }
  .mobile-thread-page .thread { --chat-bg: var(--bg); }
  .msg-line { max-width: 92%; }
  .phone-row { flex-wrap: wrap; }
  .phone-row > .btn { flex: 1 1 100%; }
  .tpl-grid, .notes-grid { grid-template-columns: minmax(0, 1fr); }
  .share-row { flex-wrap: wrap; }
  .share-row > .btn { flex: 1 1 100%; }
  .gym-with-route { flex-wrap: wrap; }
  .gym-route { flex: 1 1 100%; min-height: var(--tap); }
}

/* всплывающие сообщения поверх модальных окон (popover в верхнем слое) */
#toast[popover] { top: auto; right: auto; height: auto; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; overflow: visible; }
#toast[popover]:popover-open { display: grid; }
@media (max-width: 860px) { #toast.over-dialog { top: calc(12px + var(--safe-t)); bottom: auto; } }

/* =====================================================================
   v8: дизайн по макетам (тёмная основа, яркая карточка «Сегодня», кольца,
   «+» по центру меню, экран тренировки) — в цветах PULSE
   ===================================================================== */

/* ---------- логотип PULSE. ---------- */
.wordmark { font-weight: 800; letter-spacing: -0.035em; color: var(--text); white-space: nowrap; }
.wordmark b { font-weight: 800; color: var(--accent-text); }
.wordmark.md { font-size: 22px; }
.wordmark.xl { font-size: clamp(42px, 12vw, 56px); line-height: 1; }
.rail .brand { color: var(--text); text-decoration: none; order: -2; }
.rail .brand:hover { text-decoration: none; }

.art { display:inline-grid; place-items:center; flex:none; color:var(--text-2); }
.art > svg { width:60%; height:60%; }

/* ---------- «+» в меню ---------- */
.nav-fab { order: -1; display: flex; align-items: center; gap: 10px; min-height: var(--tap); margin: 0 0 14px; padding: 10px 14px; border: 0; border-radius: 14px;
  background: var(--brand-fill); color: var(--brand-ink); font: inherit; font-weight: 700; cursor: pointer; touch-action: manipulation; box-shadow: 0 8px 22px -12px var(--brand-ring); }
.nav-fab .fab-circle { display: grid; place-items: center; }
.nav-fab svg { width: 20px; height: 20px; stroke-width: 2.4; }
@media (hover: hover) { .nav-fab:hover { filter: brightness(1.06); } }

/* ---------- приветствие ---------- */
.hello { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.hello h1 { font-size: clamp(22px, 2.4vw, 28px); }
.hello p { margin-top: 2px; font-size: 14px; }
.hello-ava { flex: none; border-radius: 50%; }
.hello-ava .avatar { width: 48px; height: 48px; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent-border); }

/* ---------- карточка «Сегодня» ---------- */
.today-card { position: relative; isolation: isolate; overflow: hidden; display: flex; width: 100%; min-height: 158px; margin: 0 0 20px; padding: 18px 18px 18px 20px;
  border: 0; border-radius: 26px; background: var(--brand-fill); color: var(--brand-ink); text-align: left; text-decoration: none; font: inherit; cursor: pointer;
  box-shadow: 0 18px 36px -22px var(--brand-ring); transition: transform .15s ease, filter .15s ease; }
.today-card::before { content: ""; position: absolute; z-index: -1; right: -60px; top: -70px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .35), transparent); }
:root[data-theme="light"] .today-card::before { background: radial-gradient(closest-side, rgba(255, 255, 255, .18), transparent); }
.today-card:hover { text-decoration: none; filter: brightness(1.04); }
.today-card:active { transform: scale(.99); }
.today-card:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 3px; }
.tc-text { position: relative; z-index: 1; display: grid; align-content: start; gap: 4px; max-width: 64%; min-width: 0; }
.tc-label { font-size: 13px; font-weight: 600; opacity: .78; }
.tc-title { font-size: clamp(20px, 5.4vw, 24px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.tc-meta { font-size: 14px; opacity: .8; }
.tc-action { display: inline-flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 15px; font-weight: 700; }
.tc-play { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--brand-ink); color: var(--brand-fill); }
.tc-play svg { width: 18px; height: 18px; }
.tc-art { position: absolute; right: -4px; bottom: -10px; width: 150px; height: 150px; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .18)); }
@media (max-width: 380px) { .tc-art { width: 124px; height: 124px; } .tc-text { max-width: 66%; } }

/* ---------- кольца «Мой прогресс» ---------- */
.ring-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.ring-tile { display: grid; justify-items: center; align-content: start; gap: 8px; min-width: 0; padding: 14px 6px 12px; border-radius: 22px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; text-align: center; text-decoration: none; cursor: pointer; }
.ring-tile:hover { text-decoration: none; border-color: var(--line-strong); }
.ring-tile .ring .center b { font-size: 17px; }
.rt-cap { font-size: 12px; line-height: 1.25; color: var(--text-2); }
.ring.over .fg { stroke: var(--warn); }

/* ---------- быстрые действия ---------- */
.qa-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.qa-tile { display: grid; justify-items: center; gap: 8px; min-width: 0; padding: 12px 4px 10px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface);
  color: var(--text); font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; touch-action: manipulation; }
.qa-tile:hover { text-decoration: none; border-color: var(--accent-border); }
.qa-tile:active { transform: scale(.97); }
.qa-ico { position: relative; width: 50px; height: 50px; display: grid; place-items: center; border-radius: 16px; background: var(--surface-2); color: var(--accent-text); }
.qa-ico svg { width: 24px; height: 24px; }
.qa-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- тренер на главной ---------- */
.coach-card .coach-head { min-width: 0; }
.coach-open { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: inherit; text-decoration: none; border-radius: 12px; }
.coach-open:hover { text-decoration: none; }
.coach-open .chev { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.coach-who { display: grid; gap: 1px; min-width: 0; }
.coach-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home .coach-card.compact { margin-bottom: 20px; }

/* ---------- питание на главной ---------- */
.food-today { display: grid; gap: 12px; margin-bottom: 20px; color: var(--text); text-decoration: none; border-radius: 22px; }
.food-today:hover { text-decoration: none; border-color: var(--line-strong); }
.ft-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ft-kcal { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.lanes-compact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lc { display: grid; gap: 6px; min-width: 0; }
.lc > span { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc > span b { color: var(--text); font-variant-numeric: tabular-nums; }
.lc > span small { font-size: inherit; }
.lc .bar { height: 6px; }
.lc.protein .bar > i { background: var(--protein); }
.lc.fat .bar > i { background: var(--fat); }
.lc.carbs .bar > i { background: var(--carbs); }

/* ---------- план тренировок ---------- */
.seg-wide { display: flex; width: 100%; margin-bottom: 14px; border-radius: 16px; }
.seg-wide button { flex: 1 1 0; border-radius: 12px; }
.seg-wide button[aria-pressed="true"] { background: var(--brand-fill); color: var(--brand-ink); }
.week-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.week-sum { font-size: 14px; font-weight: 600; color: var(--text-2); text-align: center; }
.days { gap: 6px; }
.day { position: relative; border-radius: 16px; }
.day[aria-pressed="true"] { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--brand-ink); }
.day[aria-pressed="true"] b { color: var(--brand-ink); }
.day-dot { position: absolute; bottom: 6px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: transparent; }
.day.has-mark .day-dot { background: var(--accent-text); }
.day.has-mark[aria-pressed="true"] .day-dot { background: var(--brand-ink); }
.plan-list { display: grid; gap: 10px; }
.plan-day-group { margin-bottom: 16px; }
.pdg-title { font-size: 15px; font-weight: 700; color: var(--text-2); margin: 4px 0 8px; }
.plan-card { position: relative; display: flex; align-items: center; gap: 12px; min-height: 96px; padding: 14px 12px 14px 22px; border: 1px solid var(--line); border-radius: 22px;
  background: var(--surface); color: var(--text); text-decoration: none; overflow: hidden; transition: border-color .15s ease, transform .15s ease; }
.plan-card:hover { text-decoration: none; border-color: var(--line-strong); }
.plan-card:active { transform: scale(.99); }
.pc-stripe { position: absolute; left: 0; top: 16px; bottom: 16px; width: 5px; border-radius: 0 5px 5px 0; background: var(--brand-fill); }
.plan-card.done .pc-stripe { background: var(--ok); }
.plan-card.overdue .pc-stripe, .plan-card.skipped .pc-stripe { background: var(--warn); }
.pc-text { flex: 1; display: grid; gap: 3px; justify-items: start; min-width: 0; }
.pc-text b { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.pc-text small { font-size: 13px; color: var(--text-2); }
.pc-text .pc-day { font-size: 12px; text-transform: none; }
.pc-text .chip { margin-top: 4px; }
.pc-art { width: 76px; height: 76px; border-radius: 18px; background-color: var(--surface-2); background-size: 88%; }
.plan-card .chev { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.rest-day { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 22px; border: 1px dashed var(--line-strong); }
.rest-day > div { display: grid; gap: 4px; }
.rd-art .art { width: 72px; height: 72px; }

/* ---------- питание ---------- */
.nutri-card { display: flex; align-items: center; gap: 20px; border-radius: 24px; }
.nutri-card .ring .center b { font-size: 26px; }
.nutri-card .ring .center span { font-size: 12px; }
.nc-side { flex: 1; min-width: 0; display: grid; gap: 10px; }
.nc-side .macros { gap: 10px; }
.add-food { min-height: 52px; font-size: 16px; border-radius: 16px; }
.btn.primary.add-food, .btn.primary.block.lg { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--brand-ink); }
.meal-cards { display: grid; gap: 10px; }
.meal-cards > *, .meal-card .meal-head > .grow { min-width: 0; }
.meal-card { padding: 14px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); }
.meal-card.empty { background: transparent; border-style: dashed; }
.meal-card .meal-head { display: flex; align-items: center; gap: 12px; }
.meal-card h3 { font-size: 16px; }
.meal-ico { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 15px; }
.meal-ico svg { width: 22px; height: 22px; }
.meal-ico.breakfast { background: color-mix(in srgb, var(--fat) 18%, transparent); color: var(--fat); }
.meal-ico.lunch { background: var(--accent-soft); color: var(--accent-text); }
.meal-ico.dinner { background: color-mix(in srgb, var(--carbs) 18%, transparent); color: var(--carbs); }
.meal-ico.snack { background: var(--ok-soft); color: var(--ok); }
.meal-sum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meal-total { flex: none; font-size: 17px; font-variant-numeric: tabular-nums; }
.meal-total small { font-size: 12px; font-weight: 500; color: var(--text-2); }
.meal-card .add-meal { flex: none; }
.meal-card .meal-items { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.foods-panel .foods-list { display: grid; gap: 12px; }
.fl-meal { display: flex; gap: 12px; align-items: flex-start; }
.fl-meal ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.fl-meal li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.fl-meal li small { color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fl-kcal { flex: none; font-variant-numeric: tabular-nums; }
.foods-line { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; color: var(--text-2); min-width: 0; }
.foods-line svg { width: 15px; height: 15px; flex: none; color: var(--accent-text); }
.foods-line .fl-names { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foods-line .fl-more { flex: none; white-space: nowrap; color: var(--text); font-weight: 600; }

/* ---------- статистика ---------- */
.stats-tools { align-items: center; }
.stats-tools .seg-wide { flex: 1 1 260px; margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat-tile { display: grid; gap: 6px; align-content: start; min-width: 0; padding: 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); }
.st-head { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.st-head .st-ico { display: grid; color: var(--accent-text); }
.st-head .st-ico svg { width: 16px; height: 16px; }
.st-value { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.st-delta { font-size: 13px; font-weight: 600; color: var(--text-2); }
.st-delta.pos { color: var(--ok); }
.st-delta.neg { color: var(--warn); }
.goal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.goal-card { display: grid; gap: 8px; align-content: start; padding: 16px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); }
.goal-card > b, .goal-card div > b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rg-row { display: flex; align-items: center; gap: 12px; }
.rg-row > div { display: grid; gap: 2px; min-width: 0; }
.rg-row b { white-space: nowrap; }

/* ---------- профиль ---------- */
.avatar.xxl { width: 120px; height: 120px; font-size: 40px; }
.profile-hero { display: grid; justify-items: center; gap: 6px; margin: 0 0 24px; padding: 20px 16px 18px; border-radius: 26px; border: 1px solid var(--line); background: var(--surface); text-align: center; }
.profile-hero h2 { font-size: 22px; margin-top: 8px; overflow-wrap: anywhere; }
.profile-hero .muted { overflow-wrap: anywhere; }
.ph-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.ph-stats > div { display: grid; gap: 2px; padding: 0 4px; }
.ph-stats > div + div { border-left: 1px solid var(--line); }
.ph-stats b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ph-stats span { font-size: 12px; line-height: 1.25; color: var(--text-2); }

/* ---------- профиль тренера (п. 14) ---------- */
.coach-page { position: relative; }
.coach-hero { display: grid; justify-items: center; gap: 6px; margin: 4px 0 22px; text-align: center; }
.coach-hero h1 { font-size: 26px; margin-top: 8px; }
.coach-ava-btn { position: relative; padding: 0; border: 0; border-radius: 50%; background: none; cursor: zoom-in; }
div.coach-ava-btn { cursor: default; }
.coach-ava-btn .avatar { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent-border); }
.coach-zoom { position: absolute; right: 2px; bottom: 2px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-fill); color: var(--brand-ink); box-shadow: 0 0 0 3px var(--bg); }
.coach-zoom svg { width: 16px; height: 16px; }
.coach-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; max-width: 420px; margin: 10px 0 8px; padding: 12px 0; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.coach-stats > div { display: grid; gap: 2px; }
.coach-stats > div + div { border-left: 1px solid var(--line); }
.coach-stats b { font-size: 20px; font-weight: 800; }
.coach-stats span { font-size: 12px; color: var(--text-2); }
.coach-hero .btn.block { max-width: 420px; }
.coach-sec { margin-bottom: 20px; }
.coach-sec h2 { font-size: 17px; margin-bottom: 10px; }
.coach-about { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.chip.spec { background: var(--accent-soft); color: var(--accent-text); min-height: 32px; padding: 4px 12px; font-size: 14px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.chip-x { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: -6px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.chip-x svg { width: 14px; height: 14px; }
.achievements { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.achievements li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); overflow-wrap: anywhere; }
.ach-ico { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--fat) 16%, transparent); color: var(--fat); }
.ach-ico svg { width: 20px; height: 20px; }
.ach-edit { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.ach-edit li { display: flex; align-items: center; gap: 8px; }
.counter { justify-self: end; margin-top: -8px; }
.coach-deco { position: absolute; top: 0; right: 0; width: 96px; height: 96px; opacity: .9; pointer-events: none; }
@media (max-width: 520px) { .coach-deco { display: none; } }
dialog.lightbox { width: min(720px, calc(100vw - 24px)); background: #000; border-color: #000; }
dialog.lightbox .modal-head { background: #000; color: #fff; }
dialog.lightbox .modal-head .icon-btn { color: #fff; }
dialog.lightbox .modal-body { padding: 0; display: grid; place-items: center; background: #000; }
.lightbox-body img { display: block; width: 100%; max-height: 78vh; object-fit: contain; cursor: zoom-out; }

/* ---------- экран тренировки ---------- */
.session { padding-bottom: 8px; }
.ss-head { display: flex; align-items: center; gap: 8px; margin: -6px 0 6px -8px; }
.ss-title { font-size: clamp(20px, 5.5vw, 26px); line-height: 1.2; overflow-wrap: anywhere; }
.ss-sub { font-size: 13px; color: var(--text-2); }
.ss-finish { flex: none; }
.ss-status { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 10px 0 8px; font-variant-numeric: tabular-nums; }
.ss-timer { font-size: 22px; font-weight: 800; color: var(--accent-text); letter-spacing: -0.02em; }
.ss-progress { font-size: 13px; color: var(--text-2); }
.ss-bars { display: flex; gap: 4px; margin-bottom: 14px; }
.ss-bars i { flex: 1; height: 5px; border-radius: 3px; background: var(--track); }
.ss-bars i.done { background: var(--ok); }
.ss-bars i.cur { background: var(--brand-fill); }
.ss-result { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 14px; border-radius: 20px; border: 1px solid var(--line); }
.ss-result.done { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.ss-result.skipped { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.ss-result .grow { display: grid; gap: 2px; }
.ss-result-ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--ok); }
.ss-result.skipped .ss-result-ico { color: var(--warn); }
.ss-notes, .ss-all { margin: 0 0 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); padding: 0 14px; }
.ss-notes summary, .ss-all summary { min-height: var(--tap); display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; list-style: none; }
.ss-notes summary::-webkit-details-marker, .ss-all summary::-webkit-details-marker { display: none; }
.ss-notes summary svg { width: 18px; height: 18px; color: var(--accent-text); }
.ss-notes p { margin: 0 0 14px; white-space: pre-wrap; color: var(--text-2); }
.ss-all[open] { padding-bottom: 12px; }
.ss-card { display: grid; gap: 14px; margin-bottom: 12px; padding: 16px; border-radius: 26px; border: 1px solid var(--line); background: var(--surface); scroll-margin-top: 12px; }
.ss-ex-head { display: flex; align-items: center; gap: 14px; }
.ss-ex-head .grow { display: grid; gap: 2px; min-width: 0; }
.ss-art { width: 72px; height: 72px; border-radius: 18px; background-color: var(--surface-2); background-size: 88%; }
.ss-ex-name { font-size: 20px; line-height: 1.2; overflow-wrap: anywhere; }
.ss-plan { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.ss-plan > div { display: grid; gap: 2px; padding: 10px 4px; border-radius: 16px; background: var(--surface-2); min-width: 0; }
.ss-plan b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ss-plan span { font-size: 12px; color: var(--text-2); }
.set-table { display: grid; gap: 8px; }
.set-head, .set-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr) 52px; gap: 8px; align-items: center; }
.set-head span { font-size: 12px; color: var(--text-2); text-align: center; }
.set-no { text-align: center; font-weight: 800; color: var(--text-2); font-variant-numeric: tabular-nums; }
.set-in { min-height: 50px; padding: 8px 6px; text-align: center; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; border-radius: 14px; }
.set-in:disabled { opacity: 1; background: transparent; border-color: var(--line); color: var(--text); }
.set-in[aria-invalid="true"] { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.set-check { width: 52px; height: 50px; display: grid; place-items: center; padding: 0; border: 2px solid var(--line-strong); border-radius: 14px; background: var(--surface-2); color: var(--text-3);
  cursor: pointer; touch-action: manipulation; transition: background .15s ease, color .15s ease, transform .1s ease; }
.set-check svg { width: 24px; height: 24px; stroke-width: 2.6; }
.set-check:active:not(:disabled) { transform: scale(.94); }
.set-check.on { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--brand-ink); }
.set-row.done .set-no { color: var(--accent-text); }
.set-err { grid-column: 2 / -1; margin-top: -2px; }
.set-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.set-tools .muted { margin-left: auto; }
.ss-rest { display: flex; align-items: center; gap: 14px; margin: 0 0 10px; padding: 10px 12px; border-radius: 22px; border: 1px solid var(--accent-border); background: var(--surface); box-shadow: var(--shadow); animation: fe-in .2s ease-out; }
.rest-ring { position: relative; width: 84px; height: 84px; flex: none; }
.rest-ring svg { width: 100%; height: 100%; display: block; }
.rr-track { fill: none; stroke: var(--track); stroke-width: 7; }
.rr-bar { fill: none; stroke: var(--brand-fill); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .5s linear; }
.rest-ring .ss-rest-time { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.rest-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.rest-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.rest-top .btn { min-height: 34px; padding: 4px 8px; margin: -4px -6px -4px 0; }
.rest-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.rest-title svg { width: 18px; height: 18px; color: var(--accent-text); }
.rest-next { color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
.rest-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rest-btns .btn { min-height: 42px; }
@media (prefers-reduced-motion: reduce) { .rr-bar { transition: none; } }
/* текущий подход: подсвечен, под полями — кнопки −/+ */
.set-row.active { margin: 0 -8px; padding: 8px; border-radius: 18px; background: var(--accent-soft); }
.set-row.active .set-in:not([aria-invalid="true"]) { border-color: var(--accent-border); }
.set-steps { display: contents; }
.step-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.step-btn { min-height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer; touch-action: manipulation; }
.step-btn svg { width: 20px; height: 20px; stroke-width: 2.4; }
.step-btn:active { transform: scale(.94); background: var(--surface-2); }
.ss-thumb-wrap { position: relative; flex: none; }
.ss-thumb { width: 44px; height: 44px; border-radius: 12px; background-color: var(--surface-2); background-size: 92%; }
.ss-thumb-wrap .ss-check { position: absolute; right: -5px; bottom: -5px; width: 22px; height: 22px; font-size: 12px; box-shadow: 0 0 0 2px var(--bg); }
.ss-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ss-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ss-item .grow { display: grid; gap: 1px; min-width: 0; }
.ss-item small { color: var(--text-2); font-size: 12px; }
.ss-item.cur { border-color: var(--accent-border); background: var(--accent-soft); }
.ss-check { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--text-2); }
.ss-check svg { width: 16px; height: 16px; }
.ss-item.done .ss-check { background: var(--ok-soft); color: var(--ok); }
.ss-count { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ss-bottom-row { display: flex; align-items: center; justify-content: center; gap: 18px; }
.ss-bottom { position: sticky; bottom: 0; z-index: 20; display: block; margin: 8px -16px 0; padding: 12px 16px calc(12px + var(--safe-b));
  background: var(--tabbar-bg); border-top: 1px solid var(--line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.ss-nav { width: 52px; height: 52px; }
.ss-main { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 150px; min-height: 58px; padding: 0 26px; border: 0; border-radius: 999px;
  background: var(--brand-fill); color: var(--brand-ink); font: inherit; font-size: 17px; font-weight: 800; cursor: pointer; touch-action: manipulation; box-shadow: 0 12px 26px -14px var(--brand-ring); }
.ss-main svg { width: 22px; height: 22px; stroke-width: 2.6; }
.ss-main:active { transform: scale(.97); }
.ss-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; text-align: center; }
.ss-summary > div { display: grid; gap: 2px; padding: 10px 4px; border-radius: 14px; background: var(--surface-2); }
.ss-summary b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ss-summary span { font-size: 12px; color: var(--text-2); }
.set-log { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; padding: 0; width: 100%; }
.set-log li { padding: 2px 8px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.ex-list li:has(.set-log) { flex-wrap: wrap; }

/* ---------- «+»: быстрое добавление ---------- */
.sheet-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sheet-tile { display: grid; justify-items: start; align-content: start; gap: 4px; min-height: 108px; padding: 14px; border: 1px solid var(--line); border-radius: 20px;
  background: var(--surface-2); color: var(--text); font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; }
.sheet-tile:hover { border-color: var(--accent-border); }
.sheet-tile b { font-size: 15px; }
.sheet-tile small { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.sheet-tile .st-ico { width: 42px; height: 42px; margin-bottom: 6px; display: grid; place-items: center; border-radius: 13px; background: var(--accent-soft); color: var(--accent-text); }
.sheet-tile .st-ico svg { width: 22px; height: 22px; }
.sheet-tile.primary { grid-column: 1 / -1; min-height: 0; grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; background: var(--brand-fill); border-color: var(--brand-fill); color: var(--brand-ink); }
.sheet-tile.primary .st-ico { grid-row: 1 / span 2; margin: 0; background: var(--brand-ink); color: var(--brand-fill); }
.sheet-tile.primary small { color: inherit; opacity: 1; font-weight: 600; }

/* ---------- календарь: время рядом с именем (п. 15) ---------- */
.cal-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cal-line b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-time { flex: none; padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-time.none { background: transparent; color: var(--text-3); padding: 1px 2px; }

/* ---------- приветствие гостя на телефоне (макет «1. Онбординг») ---------- */
main.welcome { position: relative; isolation: isolate; overflow: hidden; max-width: none; min-height: 100vh; min-height: 100dvh; padding: 0; display: flex; flex-direction: column; justify-content: flex-end;
  background: #050908; color: #F2F7F6; }
.welcome-photo { position: absolute; z-index: -1; inset: 0 0 auto 0; height: 70vh; height: 70svh; }
.welcome-photo .hero-slides { inset: 0; width: 100%; -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent 100%); mask-image: linear-gradient(180deg, #000 60%, transparent 100%); }
.welcome-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 9, 8, .45) 0%, rgba(5, 9, 8, 0) 22%, rgba(5, 9, 8, 0) 55%, #050908 100%); }
.welcome-controls { top: calc(14px + var(--safe-t)); right: 14px; bottom: auto; }
.welcome-copy { display: grid; gap: 14px; padding: 0 24px calc(26px + var(--safe-b)); max-width: 560px; }
.welcome-logo .wordmark { color: #F2F7F6; }
.welcome-logo .wordmark b { color: #CBFEF7; }
.welcome-lead { font-size: 17px; line-height: 1.45; color: #C5D0CE; max-width: 340px; }
.welcome-points { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.welcome-points li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(242, 247, 246, .16); background: rgba(5, 9, 8, .55); font-size: 13px; color: #DCE5E3; }
.welcome-points svg { width: 15px; height: 15px; color: #CBFEF7; }
main.welcome .btn.primary, main.welcome .btn.primary.block.lg { background: #CBFEF7; border-color: #CBFEF7; color: #06110F; } /* экран приветствия всегда тёмный (фото) — кнопка мятная в обеих темах */
.welcome .btn.ghost { color: #F2F7F6; border-color: rgba(242, 247, 246, .28); }
.welcome .btn.ghost:hover { background: rgba(242, 247, 246, .08); }
.welcome-note { font-size: 13px; color: #8D9A98; text-align: center; }
.btn.lg { min-height: 56px; font-size: 17px; border-radius: 18px; }
.welcome .btn { border-radius: 18px; }

/* ---------- вход и регистрация ---------- */
.auth-mobile-top { display: none; }
.m-br { display: none; }
.auth-head { display: grid; gap: 6px; }
.auth-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); }
.auth-tab { flex: 1 1 0; min-height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--text-2); font-weight: 600; text-decoration: none; }
.auth-tab:hover { text-decoration: none; color: var(--text); }
.auth-tab[aria-selected="true"] { background: var(--brand-fill); color: var(--brand-ink); }
.auth-card .wordmark { font-size: inherit; }

/* ---------- телефон ---------- */
@media (max-width: 860px) {
  /* «+» по центру нижнего меню, приподнят над ним */
  .nav-fab { order: 0; flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 0; margin: 0; padding: 0; min-height: 52px; background: none; box-shadow: none; color: var(--text-2); }
  .nav-fab .fab-circle { width: 54px; height: 54px; margin-top: -22px; border-radius: 50%; background: var(--brand-fill); color: var(--brand-ink); box-shadow: 0 0 0 4px var(--bg), 0 10px 22px -8px var(--brand-ring); }
  .nav-fab svg { width: 26px; height: 26px; }
  .nav-fab .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav-link.mobile-current { color: var(--accent-text); }
  .rail .brand { display: none; }
  .ring-tile { padding: 12px 4px 10px; border-radius: 20px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nutri-card { gap: 14px; padding: 16px; }
  .nutri-card .ring { width: 116px !important; height: 116px !important; }
  .nutri-card .ring svg { width: 116px; height: 116px; }
  .nutri-card .ring .center b { font-size: 22px; }
  /* экран тренировки: нижнее меню прячем, внизу — кнопки упражнения */
  body[data-route="workout"] .rail { display: none; }
  body[data-route="workout"] main { padding-bottom: 0; }
  .ss-bottom { margin: 8px -16px 0; }
  .ss-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-hero { border-radius: 24px; }
  /* вход: фото — на экране приветствия, здесь компактная шапка (клавиатура не перекрывает поля) */
  .auth .auth-hero { display: none; }
  .auth-mobile-top { display: flex; align-items: center; gap: 4px; margin: -4px 0 0 -10px; }
  .auth-form { padding-top: calc(12px + var(--safe-t)); }
  .auth-head h1 { font-size: 28px; line-height: 1.15; }
  .m-br { display: inline; }
}
@media (max-width: 420px) {
  .ss-bottom { margin-left: -14px; margin-right: -14px; }
  .qa-row { gap: 8px; }
  .qa-ico { width: 46px; height: 46px; }
  .ring-row { gap: 8px; }
  .nutri-card { flex-wrap: wrap; justify-content: center; }
  .nutri-card .nc-side { flex-basis: 100%; }
}
@media (max-width: 360px) {
  .set-head, .set-row { grid-template-columns: 20px minmax(0, 1fr) minmax(0, 1fr) 48px; gap: 6px; }
  .set-check { width: 48px; }
  .ss-main { min-width: 130px; padding: 0 18px; }
  .lanes-compact { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .ss-rest-bar i { transition: none; }
}

/* широкий экран: узкие страницы — по центру рабочей области, а не прижаты влево */
@media (min-width: 1100px) {
  .page.narrow { margin-inline: auto; }
}

/* календарь недели на компьютере: колонки узкие — имя и название переносятся, а не режутся
   до «Е…»; кнопка переноса — в углу карточки и не отнимает ширину */
.day-col .cal-item { position: relative; align-items: stretch; }
.day-col .cal-open { padding: 8px 8px 8px 10px; }
.day-col .cal-line { flex-wrap: wrap; row-gap: 3px; }
.day-col .cal-item:has(> .icon-btn) .cal-time { margin-right: 26px; }
.day-col .cal-line b { flex-basis: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.day-col .cal-open > span:not(.cal-line) { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.day-col .cal-item > .icon-btn { position: absolute; top: 2px; right: 2px; }

/* ---------- карта залов тренера (Яндекс, по нажатию) ---------- */
.gym-map { display: grid; gap: 10px; min-width: 0; }
.gm-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.gm-tabs::-webkit-scrollbar { display: none; }
.gm-tabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); max-width: 80%; padding: 6px 14px 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.gm-tabs button svg { width: 16px; height: 16px; flex: none; }
.gm-tabs button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.gm-frame { position: relative; aspect-ratio: 4 / 3; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); background:
  radial-gradient(circle at 30% 35%, var(--accent-soft) 0 18%, transparent 19%),
  repeating-linear-gradient(0deg, transparent 0 38px, var(--line) 38px 39px),
  repeating-linear-gradient(90deg, transparent 0 38px, var(--line) 38px 39px), var(--surface); }
@media (min-width: 861px) { .gm-frame { aspect-ratio: 16 / 9; } }
.gm-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.gm-load { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 16px; border: 0; background: none; color: var(--text); cursor: pointer; text-align: center; }
.gm-load b { font-size: 17px; }
.gm-load small { color: var(--text-2); font-size: 13px; }
.gm-pin { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-fill); color: var(--brand-ink); box-shadow: 0 10px 24px -10px var(--brand-ring); margin-bottom: 4px; }
.gm-pin svg { width: 26px; height: 26px; }
.gm-load:focus-visible { outline: 2px solid var(--accent-text); outline-offset: -4px; border-radius: 22px; }
.gm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gm-info { grid-column: 1 / -1; min-width: 0; display: grid; gap: 1px; }
.gm-actions .btn { min-height: 44px; }
.gm-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-info small { color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- главная тренера: плитки с иконками, ближайшие тренировки ---------- */
.tiles-ico .tile { grid-template-columns: 36px minmax(0, 1fr); grid-template-areas: "ico label" "ico val"; column-gap: 10px; row-gap: 0; align-items: center; }
.tiles-ico .tile > span:not(.tile-ico) { line-height: 1.25; }
.tiles-ico .tile > b { line-height: 1.15; }
.tile-ico { grid-area: ico; align-self: center; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); }
.tile-ico svg { width: 19px; height: 19px; }
.tiles-ico .tile > span:not(.tile-ico) { grid-area: label; }
.tiles-ico .tile > b { grid-area: val; }
.tiles-ico .tile.warn .tile-ico { background: var(--warn-soft); color: var(--warn); }
.upcoming { margin-bottom: 18px; }
.upc-list { display: grid; gap: 8px; }
.upc-item { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; min-width: 0; }
.upc-item:hover { text-decoration: none; border-color: var(--line-strong); }
.upc-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.upc-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upc-text span { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upc-when { flex: none; max-width: 40%; text-align: right; font-size: 13px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.upc-when.today { color: var(--accent-text); }
.upc-item .chev { width: 18px; height: 18px; flex: none; color: var(--text-3); }
@media (max-width: 420px) { .upc-when { max-width: 34%; white-space: normal; } }
.notif-filter { margin-bottom: 12px; }
.notif.k-workout_done .ico { background: var(--ok-soft); color: var(--ok); }
.notif.k-workout_skipped .ico { background: var(--warn-soft); color: var(--warn); }

/* ---------- выбор темы: три карточки с превью ---------- */
.theme-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.theme-card { position: relative; display: grid; gap: 6px; justify-items: center; text-align: center; padding: 12px 8px 12px; border-radius: 20px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; min-width: 0; }
.theme-card:has(input:checked) { border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-card:has(input:focus-visible) { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.tcp { width: 100%; max-width: 92px; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; display: grid; grid-template-rows: 1fr 6px 6px; gap: 4px; padding: 8px; border: 1px solid var(--line); }
.tcp i { display: block; border-radius: 4px; }
.t-light .tcp { background: #F4F7F6; } .t-light .tcp i:nth-child(1) { background: #0A7A6C; } .t-light .tcp i:nth-child(n+2) { background: #DCE4E2; }
.t-dark .tcp { background: #090D0C; } .t-dark .tcp i:nth-child(1) { background: #CBFEF7; } .t-dark .tcp i:nth-child(n+2) { background: #26302E; }
.t-system .tcp { background: linear-gradient(135deg, #F4F7F6 0 50%, #090D0C 50% 100%); }
.t-system .tcp i:nth-child(1) { background: linear-gradient(135deg, #0A7A6C 0 50%, #CBFEF7 50% 100%); } .t-system .tcp i:nth-child(n+2) { background: linear-gradient(90deg, #DCE4E2 0 50%, #26302E 50% 100%); }
.tcp-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; line-height: 1.2; }
.tcp-name svg { width: 16px; height: 16px; flex: none; color: var(--accent-text); }
.tcp-sub { font-size: 12px; color: var(--text-2); line-height: 1.25; }
@media (max-width: 380px) { .tcp-name svg { display: none; } }
/* приветствие на планшете / раскрытом складном телефоне — текст и кнопки не растягиваются на всю ширину */
@media (min-width: 600px) { main.welcome .welcome-copy { width: 100%; max-width: 520px; margin-inline: auto; } }
/* логотип на фото-шапке входа: фон всегда тёмный — белый + мятный в обеих темах (контраст ≥ 4,5:1) */
.auth-hero .wordmark { color: #F2F7F6; }
.auth-hero .wordmark b { color: #CBFEF7; }

/* узкие экраны (320–340 px): кнопки −/+ текущего подхода — отдельной строкой во всю ширину, каждая ≥ 44 px */
@media (max-width: 340px) {
  .set-steps { display: grid; grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 8px; }
  .set-steps > span { display: none; }
}

/* =====================================================================
   v9: поиск еды по брендам, «Мои блюда», план питания от тренера
   ===================================================================== */
button.link-btn { border: 0; background: none; color: var(--accent-text); cursor: pointer; border-radius: 8px; }
.link-btn svg { width: 18px; height: 18px; flex: none; margin-right: 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.tag svg { width: 12px; height: 12px; }
.tag.ok { background: var(--accent-soft); color: var(--accent-text); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
:root { --subst: #FFB86B; }                 /* замены в плане питания: оранжевый, читаемый в обеих темах */
:root[data-theme="light"] { --subst: #9A4F00; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }

/* лист «Добавить еду» */
.fp { gap: 12px; }
.fp-meals button { padding: 0 6px; font-size: 13px; min-height: 40px; }
.fp-area { display: grid; gap: 12px; min-width: 0; }
.fp-sec { display: grid; gap: 8px; min-width: 0; }
.fp-sec-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fp-sec-head h3 { font-size: 15px; color: var(--text-2); font-weight: 700; }
.fp-sec-head .link-btn svg { width: 16px; height: 16px; margin-right: 4px; }
.plan-editor .segmented.block button { padding: 0 8px; line-height: 1.2; }
.fr-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.fr-list li + li { border-top: 1px solid var(--line); }
.fr-row { display: flex; align-items: stretch; background: var(--surface); }
.fr-row > .fr { flex: 1; min-width: 0; padding-right: 6px; }
.fr-quick { flex: none; align-self: center; margin-right: 10px; width: var(--tap); height: var(--tap); border-radius: 50%; background: var(--brand-fill); color: var(--brand-ink); border: 0; }
.fr-quick svg { width: 20px; height: 20px; }
.fr { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 10px 14px; border: 0; background: var(--surface); text-align: left; color: var(--text); touch-action: manipulation; }
.fr:focus-visible { outline: 2px solid var(--accent-text); outline-offset: -2px; }
@media (hover: hover) { .fr:hover { background: var(--surface-2); } }
.fr-ico { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); }
.fr-ico svg { width: 18px; height: 18px; }
.fr-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.fr-name { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.fr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--text-2); min-width: 0; }
.fr-brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.fr-kcal { flex: none; display: grid; justify-items: end; text-align: right; line-height: 1.15; }
.fr-kcal b { font-size: 16px; font-variant-numeric: tabular-nums; }
.fr-kcal small { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.fp-tip { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--accent-soft); border: 1px dashed var(--accent-border); font-size: 14px; color: var(--text-2); }
.fp-tip > svg { flex: none; width: 20px; height: 20px; color: var(--accent-text); margin-top: 2px; }
.fp-tools { display: grid; gap: 4px; }
.fp-tools > .btn { justify-self: start; }
.fp-empty { display: grid; gap: 8px; padding: 14px; }
.fp-online { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; }
.fp-back { min-height: 40px; color: var(--text-2); font-size: 14px; justify-self: start; }
.fp-back svg { width: 18px; height: 18px; }
.fp-card { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.fp-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.fp-name svg { width: 18px; height: 18px; color: var(--accent-text); flex: none; }
.fp-card > .tag { justify-self: start; }
.qchips { display: flex; flex-wrap: wrap; gap: 8px; }
.qchip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; touch-action: manipulation; }
.qchip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.fp-preview { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid var(--accent-border); min-height: 52px; align-content: center; }
.fp-preview:empty { display: none; }
.mline { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.mline b { font-size: 18px; font-variant-numeric: tabular-nums; }
.mline span { color: var(--text-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.fp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fp-portion button { min-width: 52px; padding: 0 10px; }
.fp-ings, .de-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.fp-ing { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px 10px; padding: 8px 12px; background: var(--surface); }
.de-list .fp-ing { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.fp-ing + .fp-ing { border-top: 1px solid var(--line); }
.fp-ing.off .fp-ing-name span { color: var(--text-3); text-decoration: line-through; }
.fp-ing-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; cursor: pointer; }
.fp-ing-name small { color: var(--text-2); }
.fp-ing-name input[type="checkbox"], .check-list input, .check-line input { flex: none; width: 22px; height: 22px; accent-color: var(--primary); }
.fp-ing-g { display: inline-flex; align-items: center; gap: 4px; }
.fp-ing-g .input { width: 76px; min-height: 40px; padding: 6px 8px; text-align: right; }
.fp-ing-g small { color: var(--text-2); }
.fp-ing-kcal { font-size: 13px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.de-empty { padding: 14px; list-style: none; }
@media (max-width: 380px) {
  .fp-ing, .de-list .fp-ing { grid-template-columns: minmax(0, 1fr) auto; }
  .fp-ing-kcal { grid-column: 1; text-align: left; min-width: 0; }
  .de-list .fp-ing > .icon-btn { grid-column: 2; grid-row: 2; justify-self: end; }
}

/* дневник: блюдо одной строкой с составом, «сохранить как блюдо» */
.meal-dish .meal-name > div:first-child { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.meal-dish .meal-name > div:first-child svg { width: 16px; height: 16px; color: var(--accent-text); flex: none; }
.meal-name .tag { margin-left: 6px; }
.save-dish { margin-top: 6px; font-size: 14px; color: var(--accent-text); }
.save-dish svg, .plan-note svg { width: 16px; height: 16px; margin-right: 6px; flex: none; }
.fl-dish small.muted { font-size: 12px; white-space: normal; }
.fl-meal > .grow, .fl-meal li > span { min-width: 0; overflow-wrap: anywhere; }

/* страница «Мои блюда» */
.dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.dish-card { display: grid; gap: 10px; padding: 16px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); min-width: 0; align-content: start; }
.dc-head { display: flex; gap: 12px; align-items: center; }
.dc-head h3 { font-size: 17px; overflow-wrap: anywhere; }
.dc-kcal { flex: none; font-size: 18px; font-variant-numeric: tabular-nums; }
.dc-kcal small { font-size: 12px; color: var(--text-2); font-weight: 500; }
.dc-items { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: 14px; }
.dc-items li { display: flex; justify-content: space-between; gap: 10px; }
.dc-items li span { min-width: 0; overflow-wrap: anywhere; }
.dc-items li small { color: var(--text-2); white-space: nowrap; }
.dc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 420px) { .dish-grid { grid-template-columns: minmax(0, 1fr); } }

/* план питания: карточка дня */
.plan-card { display: grid; gap: 12px; }
.plan-head { display: flex; align-items: center; gap: 12px; }
.plan-head h2 { font-size: 18px; }
.plan-ring .center b { font-size: 15px; }
.plan-note { display: flex; align-items: flex-start; gap: 4px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); font-size: 14px; color: var(--text); }
.plan-note svg { color: var(--accent-text); margin-top: 3px; }
.plan-note small { color: var(--text-2); }
.plan-goal { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; }
.plan-goal b { font-size: 18px; font-variant-numeric: tabular-nums; }
.pm { display: grid; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.pm-head { display: flex; align-items: center; gap: 10px; }
.pm-head .meal-ico { width: 34px; height: 34px; border-radius: 11px; }
.pm-head .meal-ico svg { width: 18px; height: 18px; }
.pm-all { flex: none; }
.pm-all svg { width: 16px; height: 16px; }
.pm-items { list-style: none; margin: 0; padding: 0; display: grid; }
.pi { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 6px 0; }
.pi-check { width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 2px solid var(--line-strong); background: transparent; color: transparent; touch-action: manipulation; }
.pi-check svg { width: 20px; height: 20px; }
button.pi-check:not(.eaten):not(.replaced):not(.skipped) { color: var(--text-3); }
@media (hover: hover) { button.pi-check:hover { border-color: var(--accent-text); color: var(--accent-text); } }
.pi-check.eaten { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--brand-ink); }
.pi-check.replaced { background: color-mix(in srgb, var(--subst) 16%, transparent); border-color: var(--subst); color: var(--subst); }
.pi-check.skipped { background: var(--surface-2); border-color: var(--line-strong); color: var(--text-2); }
.pi-check.ro { width: 30px; height: 30px; border-width: 2px; }
.pi-check.ro svg { width: 16px; height: 16px; }
.pi-body { min-width: 0; display: grid; gap: 2px; }
.pi-name { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.pi.eaten .pi-name, .pi.skipped .pi-name { color: var(--text-2); }
.pi.replaced .pi-name { color: var(--text-2); text-decoration: line-through; }
.pi-sub { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.pi-note { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--text); }
.pi-note svg { width: 14px; height: 14px; flex: none; margin-top: 3px; }
.pi-note.warn { color: var(--subst); font-weight: 600; }
.pi-more { flex: none; }
.plan-card.compact .pm-items .pi { padding: 4px 0; }

/* меню действий над пунктом плана */
.menu-list { display: grid; gap: 8px; }
.menu-opt { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-align: left; color: var(--text); touch-action: manipulation; }
.menu-opt > span:last-child { display: grid; gap: 2px; min-width: 0; }
.menu-opt small { color: var(--text-2); font-size: 13px; }
.mo-ico { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); color: var(--accent-text); }
.mo-ico svg { width: 20px; height: 20px; }
.menu-opt.primary { border-color: var(--accent-border); background: var(--accent-soft); }
.menu-opt.primary .mo-ico { background: var(--brand-fill); color: var(--brand-ink); }
@media (hover: hover) { .menu-opt:hover { border-color: var(--line-strong); } }

/* тренер: выполнение по дням, план против цели, редактор */
.adh-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; }
.adh { display: grid; gap: 4px; justify-items: center; font-size: 12px; color: var(--text-2); }
.adh-pct { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.adh-col { width: 100%; max-width: 34px; height: 76px; border-radius: 10px; background: var(--track); display: flex; align-items: flex-end; overflow: hidden; }
.adh-col i { display: block; width: 100%; border-radius: 10px; background: var(--accent-text); }
.adh.mid .adh-col i { background: var(--fat); }
.adh.low .adh-col i { background: var(--warn); }
.adh.none .adh-col i { background: transparent; }
.adh.today .adh-day { color: var(--accent-text); font-weight: 700; }
.pd-sum { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.pd-sum-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.pd-meal { display: flex; gap: 10px; align-items: flex-start; }
.pd-meal .meal-ico { width: 34px; height: 34px; border-radius: 11px; }
.pd-meal .meal-ico svg { width: 18px; height: 18px; }
.pd-meal ul { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 2px; font-size: 14px; }
.pd-meal li { display: grid; gap: 0; }
.pd-meal li small { color: var(--text-2); }
.cmp-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cmp { display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.cmp > span { font-size: 12px; color: var(--text-2); }
.cmp b { font-variant-numeric: tabular-nums; font-size: 15px; overflow-wrap: anywhere; }
.cmp b small { font-weight: 500; color: var(--text-2); font-size: 12px; }
.cmp-dev { font-weight: 700; font-size: 12px; }
.cmp.ok .cmp-dev { color: var(--ok); }
.cmp.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.cmp.warn .cmp-dev { color: var(--warn); }
@media (max-width: 520px) { .cmp-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pe-head h2 { font-size: 20px; }
.pe-days { margin-top: 10px; }
.goal-fields { margin-bottom: 8px; }
.pe-meal { display: grid; gap: 10px; padding: 14px; }
.pe-meal h3 { font-size: 16px; }
.pe-items { list-style: none; margin: 0; padding: 0; display: grid; }
.pe-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 6px 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.pe-item .pi-name { display: flex; align-items: center; gap: 6px; }
.pe-item .pi-name svg { width: 15px; height: 15px; color: var(--accent-text); flex: none; }
.pe-portion { width: auto; min-height: 40px; padding: 6px 30px 6px 10px; }
.pe-kcal { font-size: 13px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 62px; text-align: right; }
.pe-add { justify-self: stretch; }
.pe-foot { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); z-index: 5; display: flex; justify-content: flex-end; gap: 8px; padding: 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--tabbar-bg); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: var(--shadow); }
@media (min-width: 861px) { .pe-foot { bottom: 12px; } }
@media (max-width: 520px) {
  .pe-item { grid-template-columns: minmax(0, 1fr) auto auto; }
  .pe-item .pi-body { grid-column: 1 / -1; }
  .pe-item .pe-kcal { text-align: left; min-width: 0; }
  .pe-foot { flex-wrap: wrap; }
  .pe-foot .btn { flex: 1 1 auto; min-width: 0; }
}
.check-list { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.check-list li + li { border-top: 1px solid var(--line); }
.check-list label, .check-line { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; cursor: pointer; }
.check-list label span:first-of-type { flex: 1; min-width: 0; }
.row.center { justify-content: center; align-items: center; }

/* список подопечных: строка плана питания */
.plan-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 6px; font-size: 13px; color: var(--text-2); min-width: 0; }
.plan-line > svg { width: 15px; height: 15px; color: var(--accent-text); flex: none; }
.pl-subst { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--subst); font-weight: 600; }
.pl-subst svg { width: 13px; height: 13px; flex: none; }
.notif.k-meal_plan_trainer .ico { background: var(--warn-soft); color: var(--warn); }
.pe-head h2:focus { outline: none; }

/* v9: очень узкие экраны (Galaxy Fold в сложенном виде — 280 px, iPhone SE — 320 px) */
.pm-head > .grow, .plan-head > .grow { min-width: 0; }
@media (max-width: 340px) {
  .person-head .head-actions { grid-template-columns: minmax(0, 1fr); }
  .person-head .head-actions .btn { width: 100%; }
  .pm-head { flex-wrap: wrap; }
  .plan-head .ring.plan-ring { width: 52px !important; height: 52px !important; }   /* размер кольца задан в разметке */
  .plan-head .ring svg { width: 52px; height: 52px; }
  .plan-ring .center b { font-size: 13px; }
  .adh-bars { gap: 3px; }
  .adh { font-size: 11px; }
  .adh-pct { font-size: 11px; letter-spacing: -0.02em; }
  .pi { gap: 4px 8px; }
  .pi-more { width: 36px; }
  .menu-opt { gap: 10px; padding: 8px 10px; }
}

/* узкие телефоны: одна строка кнопок внизу — короткая подпись, в листе «Добавить еду» без «Отмены» (есть крестик) */
.lbl-short { display: none; }
@media (max-width: 400px) {
  .pe-foot { flex-wrap: nowrap; }
  .pe-foot .btn.primary { flex: 1 1 auto; }
  .pe-foot .btn:not(.primary) { flex: 0 0 auto; }
  .pe-foot .lbl-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pe-foot .lbl-short { display: inline; }
  dialog:has(.fp) .modal-foot .btn:not(.primary) { display: none; }
}

/* v10 coaching tools — shared tokens cover both themes. */
.v10-page{display:flex;flex-direction:column;gap:20px}.v10-page>.page-head{margin-bottom:0}
.v10-panel{padding:20px}.v10-panel h2{font-size:17px;margin:0}.v10-panel h3{font-size:15px}
.v10-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.v10-toolbar>.input{flex:1;min-width:140px}
.v10-hub{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:16px 0}
.v10-link{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:13px 14px;border:1px solid var(--line);border-radius:13px;background:var(--surface);color:var(--accent-text);font-weight:600;font-size:13px;text-decoration:none;min-width:0}.v10-link svg{width:18px;flex-shrink:0}.v10-link:hover{background:var(--accent-soft)}
.measure-row{display:grid;grid-template-columns:1fr 90px 70px;gap:10px;padding:12px 0;border-bottom:1px solid var(--line);font-size:14px}.measure-row b{text-align:right}.measure-row>span:last-child{text-align:right;font-size:12px}.v10-history,.booking-row{padding:14px 0;border-bottom:1px solid var(--line)}.v10-history p,.booking-row p{margin:8px 0}.booking-row .v10-toolbar{margin:10px 0}.photo-compare{display:grid;grid-template-columns:1fr 1fr;gap:12px}.photo-compare figure{margin:0;min-width:0;display:flex;flex-direction:column;gap:8px}.photo-compare img{width:100%;height:260px;object-fit:contain;background:var(--surface-2);border-radius:12px}.photo-compare select{font-size:12px;max-width:100%}.pr-card{display:flex;flex-direction:column;gap:10px;padding:22px;border-radius:18px;background:var(--warn-soft);border:1px solid var(--fat)}.pr-card strong{font-size:28px}.pr-card small{color:var(--text-2)}
.slot-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}.slot{padding:12px 5px;border:1px solid var(--line-strong);border-radius:10px;background:var(--surface-2);color:var(--text);font:inherit;cursor:pointer;min-height:44px}.slot:disabled{opacity:.35;cursor:not-allowed}.slot.selected{background:var(--primary);color:var(--primary-ink);border-color:var(--primary)}.hours-row{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:8px;align-items:center}.hours-row label{font-size:12px;display:flex;gap:6px;align-items:center}.hours-row input[type=time]{padding:8px;min-width:0}.hours-row input[type=checkbox]{accent-color:var(--primary)}
.v10-table-wrap{overflow:auto}.v10-table{width:100%;border-collapse:collapse;font-size:14px}.v10-table th,.v10-table td{text-align:left;padding:14px;border-bottom:1px solid var(--line)}.v10-table th{font-size:12px;color:var(--text-2)}.v10-table a{color:var(--accent-text)}.v10-metrics{display:grid;grid-template-columns:1fr 1fr;gap:12px}.v10-metrics>div{display:flex;flex-direction:column;gap:8px;background:var(--surface-2);border-radius:12px;padding:14px}.v10-metrics b{font-size:24px}.v10-metrics span{font-size:12px;color:var(--text-2)}.answer-row{border-bottom:1px solid var(--line);padding:9px 0}.answer-row p{white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0}.question-editor{display:grid;grid-template-columns:1fr 130px;gap:8px;padding:12px;border:1px solid var(--line);border-radius:12px}.question-editor>.btn{grid-column:1/-1}
.reference-card{display:flex;align-items:center;gap:12px;width:100%;min-width:0;padding:12px;text-align:left;border:1px solid currentColor;border-radius:12px;background:transparent;color:inherit;font:inherit;cursor:pointer;margin-top:8px}.reference-card>span:first-child{font-size:25px}.reference-card>span:nth-child(2){display:flex;flex:1;flex-direction:column;gap:5px;min-width:0;overflow-wrap:anywhere}.reference-card small{font-size:11px;opacity:.8}.reference-card b{font-size:13px}.msg-quote{border-left:3px solid currentColor;margin:0 0 8px;padding:6px 9px;font-size:12px;opacity:.8;white-space:normal}.message-tools{display:flex;gap:12px;justify-content:flex-end}.message-tools button{border:0;background:none;color:var(--text-2);font-size:11px;min-height:28px;cursor:pointer}.reply-composer{display:flex;justify-content:space-between;padding:8px 16px;border-top:1px solid var(--line);font-size:12px;gap:8px;max-height:70px;overflow:auto}.reply-composer[hidden]{display:none}.reply-composer span{overflow-wrap:anywhere}.search-message{padding:12px;border:1px solid var(--line);border-radius:12px}.search-message p{white-space:pre-wrap;overflow-wrap:anywhere}.reference-picker{padding:12px;border:1px solid var(--line);border-radius:12px}
.progress-hint{padding:12px 16px;background:var(--accent-soft);font-size:13px;display:flex;flex-direction:column;gap:10px;margin-bottom:12px;border-radius:12px}.tour-highlight{outline:3px solid var(--primary)!important;outline-offset:5px;position:relative;z-index:61}.tour-coach{position:fixed;bottom:100px;right:24px;z-index:1000;width:min(370px,calc(100vw - 32px));padding:22px;background:var(--surface);border:1px solid var(--accent-border);border-radius:20px;box-shadow:var(--shadow);color:var(--text)}.tour-coach h2{font-size:18px;margin:10px 0}.tour-coach p{font-size:14px;line-height:1.6}.tour-coach small{color:var(--accent-text)}
@media(max-width:600px){.v10-panel{padding:16px}.v10-page{gap:15px}.v10-toolbar .btn{font-size:12px}.photo-compare img{height:190px}.measure-row{grid-template-columns:1fr 75px 58px;gap:6px}.question-editor{grid-template-columns:1fr}.question-editor>.btn{grid-column:auto}.tour-coach{right:16px;bottom:90px;padding:16px}.v10-table{min-width:570px}.v10-hub{gap:8px}.v10-link{font-size:12px}.thread-head .icon-btn{flex-shrink:0}}
@media(prefers-reduced-motion:reduce){.tour-highlight{scroll-behavior:auto}}

/* v11: daily actions, trustworthy summaries and review. Theme tokens are inherited. */
.flow-home{display:flex;flex-direction:column;gap:16px}
.flow-home .page-head{margin-bottom:0}
.flow-home .panel{margin:0}
.flow-hero{padding:24px;border-radius:24px;background:linear-gradient(120deg,#087f73,#208d82);color:#fff;display:flex;flex-direction:column;gap:12px}
.flow-hero h2{color:#fff;font-size:28px;line-height:1.15;margin:0;overflow-wrap:anywhere}
.flow-hero p{margin:0;opacity:.92}
.flow-hero .btn.primary{background:#f4fffc;color:#076c62;border-color:transparent;justify-content:space-between;min-height:50px}
.flow-eyebrow{font-weight:650;font-size:14px}
.flow-task,.flow-feedback{padding:20px;display:flex;flex-direction:column;gap:12px}
.flow-task-top,.flow-card-heading{display:flex;align-items:center;gap:12px;min-width:0}
.flow-task-top .grow{min-width:0}.flow-task-top p,.flow-task p,.flow-feedback p{margin:0;overflow-wrap:anywhere}
.flow-task .btn{align-self:flex-start;min-height:44px}
.flow-preview{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-wrap}
.flow-tabs{display:flex;flex-wrap:wrap;gap:8px}
.flow-tabs button{border:1px solid var(--line);border-radius:16px;padding:10px 14px;min-height:44px;background:var(--surface);color:var(--text);font:inherit;font-size:13px;font-weight:650}
.flow-tabs button[aria-pressed="true"]{background:var(--primary);color:var(--primary-ink)}
.flow-appointment{display:flex;gap:14px;align-items:center;text-decoration:none;color:var(--text);padding:16px}
.flow-appointment p{margin:4px 0 0}.flow-appointment svg{flex-shrink:0}
.flow-week{display:flex;align-items:center;gap:16px}.flow-week strong{font-size:30px;color:var(--accent-text)}
.flow-comparison,.flow-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.flow-comparison>div,.flow-metric{padding:14px;border-radius:14px;background:var(--surface-2);display:flex;flex-direction:column;gap:6px;min-width:0;overflow-wrap:anywhere}
.flow-comparison b{white-space:pre-wrap;line-height:1.6}.flow-metric b{font-size:20px}
.flow-toggle{display:flex;justify-content:space-between;gap:18px;align-items:center;padding:14px 0;border-bottom:1px solid var(--line);min-height:54px;cursor:pointer}
.flow-toggle span{display:flex;flex-direction:column;gap:4px}
.flow-toggle input{appearance:none;width:44px;height:26px;border-radius:18px;background:var(--line);position:relative;flex:0 0 44px;cursor:pointer;margin:0}
.flow-toggle input:before{content:"";position:absolute;left:3px;top:3px;width:20px;height:20px;border-radius:50%;background:var(--text);transition:transform .15s}
.flow-toggle input:checked{background:var(--primary)}
.flow-toggle input:checked:before{transform:translateX(18px);background:var(--bg)}
.flow-toggle input:disabled{cursor:default;opacity:.7}
.flow-save-status{font-size:12px;line-height:1.5;color:var(--text-2);margin:4px 0;overflow-wrap:anywhere}
.flow-inline-actions{display:flex;flex-wrap:wrap;gap:8px}.flow-inline-actions .btn{flex:1;min-width:120px}
.flow-review-text{white-space:pre-wrap;overflow-wrap:anywhere}.flow-draft{white-space:pre-wrap;font-size:12px;overflow-wrap:anywhere;max-height:260px;overflow:auto}
.session .progress-hint{font-size:14px;padding:12px;line-height:1.5}.session .ss-card>.btn.primary{width:100%;margin:12px 0;min-height:48px}
.session .ss-art{width:44px;height:44px}.session .ss-plan{margin:12px 0}.session .ss-all{margin-top:12px}
@media(min-width:900px){.flow-home{max-width:820px}.flow-home [data-testid="task-list"]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}}
@media(max-width:420px){.flow-task,.flow-feedback{padding:16px}.flow-hero{padding:20px}.flow-hero h2{font-size:25px}.flow-tabs{gap:6px}.flow-tabs button{padding:9px 10px}}
@media(prefers-reduced-motion:reduce){.flow-toggle input:before{transition:none}}

.flow-card-heading>svg,.flow-appointment>svg{width:24px;height:24px;flex:0 0 24px;color:var(--accent-text)}
.flow-appointment>div{min-width:0}.flow-appointment p{overflow-wrap:anywhere}
.session .ss-card{gap:10px}.session .ss-plan{margin:4px 0}

/* ========================================================================
   PULSE v12 / Energy — UX-first system (stage 1).
   Warm orange = main action; green = status of an already completed action.
   One strong hero only on athlete home; utility screens remain calm.
   ======================================================================== */
:root {
  --bg: #0E1013; --bg-glow: rgba(255,107,43,.035);
  --surface: #171B20; --surface-2: #20252B; --surface-3: #2A3037;
  --line: #2B323A; --line-strong: #414953;
  --text: #F7F8FA; --text-2: #ABB3BE; --text-3: #7F8A96;
  --accent: #FF702E; --accent-text: #FF955F;
  --accent-soft: rgba(255,112,46,.11); --accent-border: rgba(255,112,46,.36);
  --primary: #FF702E; --primary-ink: #19120E;
  --brand-fill: #FF702E; --brand-ink: #19120E;
  --brand-ring: rgba(255,112,46,.26);
  --bubble: #FF702E; --bubble-ink: #19120E;
  --tabbar-bg: rgba(14,16,19,.94);
}
:root[data-theme="light"] {
  --bg: #F7F8FA; --bg-glow: rgba(255,112,46,.028);
  --surface: #FFFFFF; --surface-2: #F0F2F5; --surface-3: #E8ECF0;
  --line: #E4E8EC; --line-strong: #C5CDD5;
  --text: #141922; --text-2: #555F6A; --text-3: #747E88;
  --accent: #EA570F; --accent-text: #B93E00;
  --accent-soft: rgba(234,87,15,.09); --accent-border: rgba(185,62,0,.25);
  --primary: #C64608; --primary-ink: #FFFFFF;
  --brand-fill: #C64608; --brand-ink: #FFFFFF;
  --brand-ring: rgba(198,70,8,.20);
  --bubble: #F6C4A8; --bubble-ink: #141922;
  --tabbar-bg: rgba(255,255,255,.96);
}
:root { scroll-behavior: auto; }
body[data-role="trainer"] { background-image: none; }
.energy-home { max-width: 720px; gap: 15px; }
.energy-home .page-head { align-items: center; margin-bottom: 3px; }
.energy-head h1 { font-size: clamp(27px, 4vw, 35px); letter-spacing: -.045em; line-height: 1.14; }
.energy-head .energy-date { margin: 0 0 4px; font-size: 13px; font-weight: 600; }
.energy-head-actions { display: flex; align-items: center; gap: 5px; }
.energy-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--text); }
.energy-avatar:focus-visible { outline-offset: 2px; }
.energy-home .flow-hero.energy-hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 296px; padding: 25px; justify-content: end; border: 1px solid rgba(255,255,255,.10);
  border-radius: 24px; color: #fff;
  background: #161A20;
}
.energy-hero.has-workout::before {
  content: ""; position: absolute; z-index: -2; inset: 0;
  background-image: url('/assets/hero/2-side-640.webp'); background-size: cover;
  background-position: center 33%; filter: saturate(.77);
}
.energy-hero::after { content: ""; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(0deg, rgba(9,10,13,.97), rgba(9,10,13,.48) 60%, rgba(9,10,13,.12)); }
.energy-hero-content { width: min(100%, 480px); display: grid; gap: 9px; }
.energy-hero h2 { font-size: clamp(28px, 5vw, 38px); letter-spacing: -.035em; line-height: 1.07; }
.energy-hero p { font-size: 14px; line-height: 1.4; color: #E2E6EB; opacity: 1; }
.energy-hero .flow-eyebrow { color: #FFB38A; font-size: 11px; letter-spacing: .13em; font-weight: 850; }
.energy-home .flow-hero .energy-hero-start {
  background: #FF702E; color: #17120F; display: flex; justify-content: space-between;
  font-weight: 800; width: 100%; max-width: 380px; min-height: 52px;
  padding: 12px 16px; margin-top: 5px; border: 0; border-radius: 14px; letter-spacing: -.01em;
}
.energy-hero-start svg { width: 19px; height: 19px; }
.energy-home .flow-hero .energy-hero-start:hover { background: #FF8249; text-decoration: none; }
.energy-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.energy-quick { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; padding: 13px 5px; min-height: 94px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 17px; font-size: 13px; font-weight: 750; text-decoration: none; }
.energy-quick:hover { background: var(--surface-2); text-decoration: none; }
.energy-quick:active { transform: scale(.98); }
.energy-quick-icon { width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); }
.energy-quick-icon svg { width: 20px; height: 20px; }
.energy-week, .energy-notice { display: flex; align-items: center; gap: 14px; min-height: 70px;
  padding: 14px 17px; border-radius: 17px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); }
.energy-week > div { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.energy-week strong { color: var(--text); font-size: 23px; line-height: 1.25; }
.energy-week span { color: var(--text-2); font-size: 13px; }
.energy-week > svg, .energy-notice > svg:last-child { margin-left: auto; width: 20px; height: 20px; color: var(--text-2); }
.energy-notice { background: var(--accent-soft); border-color: var(--accent-border); }
.energy-notice > svg:first-child { color: var(--accent-text); }
.energy-notice span { display: grid; flex: 1; gap: 2px; }
.energy-notice small { color: var(--text-2); }
.energy-more { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.energy-more summary { display: flex; align-items: center; justify-content: space-between; min-height: 52px;
  padding: 12px 17px; font-size: 14px; font-weight: 700; color: var(--text-2); cursor: pointer;
  list-style: none; }
.energy-more summary::-webkit-details-marker { display: none; }
.energy-more summary svg { width: 18px; height: 18px; transition: transform .18s ease; }
.energy-more[open] summary svg { transform: rotate(90deg); }
.energy-more-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; padding: 4px 12px 12px; }
.energy-more-grid .energy-quick { background: var(--surface-2); min-height: 80px; font-size: 12px; }
.energy-trainer-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.energy-trainer-summary > div { display: grid; gap: 2px; padding: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 17px; }
.energy-trainer-summary strong { font-size: 32px; font-weight: 850; line-height: 1; font-variant-numeric: tabular-nums; }
.energy-trainer-summary span { color: var(--text-2); font-size: 13px; }
.energy-home .energy-section-title { margin: 7px 0 -5px; }
.energy-section-title h2 { font-size: 19px; letter-spacing: -.02em; }
.energy-section-title .link-btn { font-size: 13px; gap: 2px; }
.energy-section-title svg { width: 16px; height: 16px; }
.energy-task-list { display: grid; gap: 8px; }
.energy-task, .energy-appointment { display: flex; align-items: center; gap: 11px;
  padding: 12px 13px; min-height: 74px; border: 1px solid var(--line);
  background: var(--surface); border-radius: 15px; color: var(--text); text-decoration: none; }
.energy-task:hover, .energy-appointment:hover { background: var(--surface-2); text-decoration: none; }
.energy-task-content { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 2px; }
.energy-task-content b { font-size: 14px; }
.energy-task-content small { font-size: 12px; }
.energy-task-content > span { font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.energy-task-action { display: flex; align-items: center; gap: 2px;
  margin-left: auto; color: var(--accent-text); font-size: 12px; font-weight: 750; white-space: nowrap; }
.energy-task-action svg { width: 16px; height: 16px; }
.energy-appointment-time { display: grid; place-items: center; border-radius: 11px; min-width: 64px; height: 46px;
  background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 800; }
.energy-appointment > span:nth-child(2) { flex: 1; min-width: 0; display: grid; gap: 3px; }
.energy-appointment small { color: var(--text-2); }
.energy-appointment svg { width: 17px; height: 17px; }
.energy-zero { border: 1px solid var(--line); background: var(--surface); border-radius: 16px;
  min-height: 124px; display: grid; place-items: center; text-align: center; gap: 2px; padding: 16px; }
.energy-zero svg { color: var(--ok); width: 25px; height: 25px; }
.energy-task-details { margin-top: 3px; }
.energy-task-details .flow-tabs { padding: 0 12px 12px; }
.energy-task-details .flow-tabs button { font-size: 12px; padding: 8px 12px; min-height: 40px; }
.energy-task-details .energy-task-list { padding: 0 12px 12px; }
/* Navbar: neutral until selected; no massive highlighted pill on mobile. */
@media(max-width:860px) {
  .rail .nav-link.nav-accent svg { background: transparent; color: inherit; width: 24px; height: 24px;
    padding: 0; border-radius: 0; box-shadow: none !important; }
  .rail .nav-link.nav-accent[aria-current="page"] svg { color: var(--accent-text); }
  .rail .nav-link.nav-accent { flex-grow: 1; }
  .rail .nav-link[aria-current="page"] .nav-label { font-weight: 800; }
  .rail .nav-link { font-size: 11px; }
  .energy-home { gap: 12px; }
  .energy-home .flow-hero.energy-hero { min-height: 280px; padding: 20px; }
  .energy-hero h2 { font-size: 30px; }
  .energy-home .energy-actions { gap: 7px; }
}
@media(max-width:375px) {
  .energy-home .flow-hero.energy-hero { min-height: 260px; }
  .energy-task-action { font-size: 0; }
  .energy-task-action svg { font-size: initial; }
  .energy-more-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(prefers-reduced-motion:reduce) {
  .energy-quick:active { transform: none; }
  .energy-more summary svg { transition: none; }
}


/* PULSE v12 / stage 2 — calm task screens, no card-within-card overload. */
.session .ss-plan-compact { display:flex; justify-content:space-between; gap:8px; padding:10px 12px;
  border-radius:14px; background:var(--surface-2); }
.session .ss-plan-compact > div { min-width:0; padding:0; flex:1; }
.session .ss-plan-compact b { font-size:18px; font-variant-numeric:tabular-nums; }
.session .ss-extra { border:0; border-top:1px solid var(--line); padding:8px 0; color:var(--text-2); font-size:13px; }
.session .ss-extra summary { cursor:pointer; min-height:38px; display:flex; align-items:center; padding:4px 0; }
.session .ss-extra .flow-inline-actions { padding:8px 0; }
.session .ss-all:not([open]) { background:transparent; border-color:var(--line); }
.session .ss-bottom .ss-main { flex:1; max-width:350px; min-width:0; }
.session .ss-bottom-row { gap:10px; }
.fp-more, .fp-help { border-top:1px solid var(--line); padding:9px 0; color:var(--text-2); }
.fp-more > summary, .fp-help > summary { cursor:pointer; font-size:13px; min-height:32px; display:flex; align-items:center; }
.fp-more .btn { margin:8px 0; }
.fp-more details { margin-top:8px; }
.fp-more .row { margin-top:8px; }
.fp .fp-sec { margin-bottom:12px; }
.fp .fr-quick:disabled { opacity:.55; pointer-events:none; }
.booking-day-strip { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:5px; width:100%; }
.booking-day { min-height:62px; display:flex; flex-direction:column; justify-content:center; align-items:center;
  gap:1px; background:var(--surface); border:1px solid var(--line); border-radius:12px; color:var(--text); font:inherit; cursor:pointer; }
.booking-day small { font-size:11px; color:var(--text-2); }
.booking-day b { font-size:16px; }
.booking-day[aria-pressed="true"] { background:var(--accent-soft); border-color:var(--accent-border); color:var(--accent-text); }
.booking-availability { border:1px solid var(--line); border-radius:14px; background:var(--surface); padding:12px 16px; }
.booking-availability summary, .booking-policy summary { cursor:pointer; min-height:38px; display:flex; align-items:center; }
.booking-availability .slot-grid { margin:8px 0; }
.booking-policy { margin-top:4px; }
@media(max-width:360px) { .booking-day-strip { gap:3px; } .booking-day { min-height:56px; border-radius:9px; } }
@media(prefers-reduced-motion:reduce) { .booking-day, .session .ss-main { transition:none; } }

/* PULSE v12 / Stage 3: dense information is one tap away, never in the way. */
.athlete-focus { gap: 14px; }
.athlete-focus-actions, .athlete-focus-extra { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.athlete-focus-actions .v10-link, .athlete-focus-extra .v10-link {
  min-height: 55px; padding: 11px; font-weight: 700; justify-content: center; text-align: center; font-size: 13px;
}
.athlete-focus-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.athlete-focus-metric { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0;
  padding: 17px 13px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.athlete-focus-metric > span { font-size: 12px; color: var(--text-2); }
.athlete-focus-metric > strong { font-size: clamp(21px,4.5vw,29px); font-weight: 840; letter-spacing: -.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.athlete-focus-metric > small { font-size: 11px; line-height: 1.4; }
.athlete-focus-details, .athlete-more, .energy-progress-more {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; min-width: 0;
}
.athlete-focus-details > summary, .athlete-more > summary, .energy-progress-more > summary {
  display: flex; align-items: center; min-height: 50px; cursor: pointer; padding: 12px 16px;
  font-weight: 700; font-size: 14px; list-style: none;
}
.athlete-focus-details > summary::-webkit-details-marker,
.athlete-more > summary::-webkit-details-marker,
.energy-progress-more > summary::-webkit-details-marker { display: none; }
.athlete-focus-details > summary::after, .athlete-more > summary::after,
.energy-progress-more > summary::after { content: '⌄'; margin-left: auto; color: var(--text-2); }
.athlete-focus-details[open] > summary::after, .athlete-more[open] > summary::after,
.energy-progress-more[open] > summary::after { transform: rotate(180deg); }
.athlete-focus-details > :not(summary), .energy-progress-more-content { margin: 0 12px 12px; }
.athlete-more { margin: 10px 0 14px; }
.athlete-more-links { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; padding: 0 12px 12px; }
.athlete-more-links > a { display: grid; place-items: center; min-height: 48px; padding: 8px; text-align: center;
  border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); text-decoration: none; font-size: 12px; font-weight: 650; }
.athlete-more-links > a[aria-current="page"] { border-color: var(--accent-border); color: var(--accent-text); }
.energy-progress-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
.energy-progress-goal { margin: 12px 0; }
.energy-progress-goal > h2 { font-size: 15px; margin: 0 0 8px; }
.energy-progress-goal .goal-card { padding: 8px 0; background: transparent; border: 0; }
.energy-progress-more-content { display: grid; gap: 12px; }

@media (max-width: 430px) {
  .athlete-focus-metrics { gap: 6px; }
  .athlete-focus-metric { padding: 12px 9px; }
  .athlete-focus-metric > strong { font-size: 21px; }
  .athlete-focus-actions, .athlete-more-links { gap: 6px; }
  .athlete-focus-actions .v10-link { font-size: 12px; padding: 8px; }
  .energy-progress-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 350px) {
  .athlete-focus-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .athlete-focus-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* v12 stage 4: прогрессивное раскрытие данных, без лишних панелей на первом экране */
.wellness-detail{padding:0!important;overflow:hidden}
.wellness-detail>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:52px;padding:16px 18px;cursor:pointer;font-weight:650;list-style:none}
.wellness-detail>summary::-webkit-details-marker{display:none}
.wellness-detail>summary svg{width:18px;height:18px;flex:none;transition:transform .18s ease}
.wellness-detail[open]>summary svg{transform:rotate(90deg)}
.wellness-detail-body{padding:0 18px 18px}
.wellness-detail:focus-within{outline:2px solid var(--primary);outline-offset:2px}
.wellness-summary{width:100%}
.settings-secondary{border-radius:16px;border:1px solid var(--line);overflow:hidden}
.settings-secondary>summary{cursor:pointer;list-style:none;padding:17px 18px;min-height:52px;font-weight:650}
.settings-secondary>summary::-webkit-details-marker{display:none}
.settings-secondary>summary:after{content:'⌄';float:right}
.settings-secondary[open]>summary:after{content:'⌃'}
.settings-secondary>.settings-advanced-content{padding:0 12px 14px}
.settings-secondary .settings-groups{margin:0}
@media(prefers-reduced-motion:reduce){.wellness-detail>summary svg{transition:none}}
@media(max-width:430px){.wellness-detail>summary{padding:14px 15px}.wellness-detail-body{padding:0 15px 15px}}

/* v12 Stage 4: компактный конструктор программ; редкие инструменты раскрываются по запросу */
.templates-more{border:1px solid var(--line);border-radius:14px;overflow:hidden}
.templates-more>summary{list-style:none;padding:13px 16px;min-height:48px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;font-weight:600}
.templates-more>summary::-webkit-details-marker{display:none}
.templates-more>summary svg{width:18px;height:18px;transition:transform .18s ease}
.templates-more[open]>summary svg{transform:rotate(90deg)}
.templates-more-actions{padding:0 16px 16px;flex-wrap:wrap}
.templates-simple-toolbar{justify-content:space-between}
@media (max-width:430px){.templates-simple-toolbar{align-items:stretch}.templates-simple-toolbar>.row{display:grid;grid-template-columns:1fr 1fr;width:100%}.templates-simple-toolbar>.row>.btn{font-size:12px;padding:11px 7px}}
@media (prefers-reduced-motion:reduce){.templates-more>summary svg{transition:none}}

/* ========================================================================
   PULSE Flow Stage 7 — Runna's day-first hierarchy + StepsApp progress.
   Intentional break from heavy Energy photo cards: light working surfaces,
   one orange CTA per view, readable rings and uncluttered trainer queue.
   ======================================================================== */
:root[data-theme="light"]{
  --bg:#F7F9FC;--surface:#FFFFFF;--surface-2:#F1F4F8;--surface-3:#E9EDF3;
  --text:#172337;--text-2:#617083;--text-3:#7B8798;--line:#E7EBF0;
  --accent:#F76324;--accent-text:#D94709;--accent-soft:#FFF0E8;--accent-border:#FFCBB4;
  --primary:#F76324;--primary-ink:#FFF;--brand-fill:#F76324;--brand-ink:#FFF;
  --tabbar-bg:rgba(255,255,255,.90);
}
:root[data-theme="dark"]{
  --bg:#101923;--surface:#1C2833;--surface-2:#263542;--surface-3:#304252;
  --line:#344450;--text:#F6F8FA;--text-2:#BBC8D4;--text-3:#93A2AE;
  --accent:#FF7945;--accent-text:#FFA176;--primary:#FF7945;--primary-ink:#15191F;
  --brand-fill:#FF7945;--brand-ink:#15191F;--tabbar-bg:rgba(20,31,42,.88);
}
.flowx-home {max-width:710px;gap:16px}
.flowx-head {margin-bottom:0!important}
.flowx-head h1{font-size:clamp(27px,5vw,36px);letter-spacing:-.045em;line-height:1.08;margin:3px 0 5px}
.flowx-date{font-size:13px;font-weight:650;margin:0!important}
.flowx-lead{font-size:14px;margin:0!important;line-height:1.45}
.flowx-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;min-width:0;padding:7px 6px;
  border-radius:20px;background:var(--surface);border:1px solid var(--line)}
.flowx-day{min-width:0;min-height:62px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  color:var(--text-2);text-decoration:none;border-radius:14px;font-size:11px;font-weight:600;transition:background .18s ease,color .18s ease,transform .18s ease}
.flowx-day b{font-variant-numeric:tabular-nums;font-size:16px;color:var(--text);line-height:1.2}
.flowx-day i{width:5px;height:5px;border-radius:50%;background:var(--line-strong)}
.flowx-day.done i{background:#23BD7B}.flowx-day.overdue i,.flowx-day.skipped i{background:#E45354}
.flowx-day.today i,.flowx-day.planned i{background:var(--accent)}
.flowx-day.selected{background:var(--accent-soft);outline:1px solid var(--accent-border);color:var(--accent-text)}
.flowx-day.selected b{color:var(--accent-text)}.flowx-day:active{transform:scale(.96)}
.flowx-focus{position:relative;display:flex;flex-direction:column;gap:13px;padding:23px;border:1px solid var(--line);
 background:var(--surface);border-radius:25px;min-height:225px;box-shadow:0 8px 30px rgba(24,41,61,.045)}
.flowx-focus::before{content:"";position:absolute;inset:0 0 auto;height:6px;border-radius:25px 25px 0 0;background:linear-gradient(90deg,#F76324,#FFB477)}
.flowx-kicker{letter-spacing:.105em;color:var(--accent-text);font-size:11px;font-weight:850}
.flowx-focus h2{font-size:clamp(25px,5vw,34px);letter-spacing:-.04em;line-height:1.14;margin:0;max-width:500px}
.flowx-focus p{margin:0;color:var(--text-2);font-size:14px}
.flowx-primary{margin-top:auto;display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:54px;
 border-radius:15px;padding:13px 18px;background:#F76324;color:#FFF;text-decoration:none;font-weight:800;font-size:15px;
 transition:transform .14s ease,background .14s ease;touch-action:manipulation}
.flowx-primary:hover{background:#E95114;color:#FFF;text-decoration:none}.flowx-primary:active{transform:scale(.985)}
.flowx-primary svg{width:19px;height:19px;flex:none}
.flowx-progress{display:flex;align-items:center;gap:18px;min-width:0;padding:16px;border:1px solid var(--line);
 background:var(--surface);border-radius:22px;color:var(--text);text-decoration:none}
.flowx-progress:hover{text-decoration:none;border-color:var(--accent-border)}
.flowx-progress .ring .fg{stroke:#1DC586}.flowx-progress .ring .center b{font-size:22px;letter-spacing:-.04em}
.flowx-progress .ring .center span{font-size:10px}.flowx-progress .ring .bg{stroke:var(--surface-2)}
.flowx-progress-copy{min-width:0;flex:1;display:flex;flex-direction:column;gap:4px}
.flowx-progress-copy>small{color:var(--text-2);font-weight:700;font-size:12px}
.flowx-progress-copy>strong{font-size:20px;line-height:1.2;letter-spacing:-.03em}
.flowx-progress-copy>span:not(.flowx-progress-more){color:var(--text-2);font-size:12px}
.flowx-progress-more{display:flex;align-items:center;gap:3px;color:var(--accent-text);font-size:12px;font-weight:750;margin-top:7px}
.flowx-progress-more svg{width:15px;height:15px}
.flowx-two-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.flowx-metric{display:flex;align-items:center;gap:11px;min-width:0;min-height:74px;padding:12px;
 border-radius:18px;background:var(--surface);border:1px solid var(--line);text-decoration:none;color:var(--text)}
.flowx-metric:hover{text-decoration:none;background:var(--surface-2)}
.flowx-metric-symbol{width:42px;height:42px;display:grid;place-items:center;flex:none;border-radius:14px;background:#FFF2E9;color:#DB5B19}
.flowx-water .flowx-metric-symbol{background:#EAF5FF;color:#1785D6}
.flowx-metric-symbol svg{width:22px;height:22px}
.flowx-metric-copy{display:flex;flex-direction:column;min-width:0;gap:3px;flex:1}
.flowx-metric-copy small{color:var(--text-2);font-size:12px}
.flowx-metric-copy strong{font-size:13px;line-height:1.25;overflow-wrap:anywhere}
.flowx-metric>svg{width:14px;height:14px;color:var(--text-3);flex:none}
.flowx-expand{border:1px solid var(--line);background:var(--surface);border-radius:18px;overflow:clip}
.flowx-expand>summary{display:flex;align-items:center;gap:11px;min-height:55px;padding:13px 16px;
 cursor:pointer;list-style:none;font-size:14px;font-weight:750;color:var(--text)}
.flowx-expand>summary::-webkit-details-marker{display:none}
.flowx-expand>summary svg{width:18px;height:18px;color:var(--accent-text)}
.flowx-expand>summary svg:last-child{margin-left:auto;transition:transform .18s ease;color:var(--text-2)}
.flowx-expand[open]>summary svg:last-child{transform:rotate(90deg)}
.flowx-expand>.meal-plan-day{margin:0;border:0;border-top:1px solid var(--line);border-radius:0}
.flowx-expand .energy-more-grid{padding:12px}
.flowx-trainer-tip{display:flex;align-items:center;gap:11px;min-height:62px;padding:13px 15px;border-radius:17px;
 background:var(--accent-soft);color:var(--text);text-decoration:none}
.flowx-trainer-tip>svg:first-child{color:var(--accent-text);width:20px;height:20px}
.flowx-trainer-tip>svg:last-child{margin-left:auto;width:18px;height:18px}
.flowx-trainer-tip span{flex:1;display:grid;gap:3px}.flowx-trainer-tip small{color:var(--text-2)}
.flowx-trainer-priority{display:flex;align-items:center;gap:15px;background:var(--surface);border:1px solid var(--line);border-radius:22px;padding:19px 20px}
.flowx-priority-icon{display:grid;place-items:center;border-radius:50%;width:74px;height:74px;flex:none;
 background:var(--accent-soft);color:var(--accent-text);box-shadow:inset 0 0 0 7px var(--surface-2)}
.flowx-priority-icon svg{width:27px;height:27px}
.flowx-priority-number{display:grid;gap:4px}.flowx-priority-number strong{font-size:42px;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:-.05em}
.flowx-priority-number span{font-size:14px;color:var(--text-2)}
.flowx-section-title{margin:6px 0 -7px!important}
.flowx-attention-list{display:grid;gap:8px}
.flowx-attention-item,.flowx-appointment{display:flex;align-items:center;gap:12px;min-height:74px;padding:12px 13px;
 border-radius:16px;border:1px solid var(--line);background:var(--surface);color:var(--text);text-decoration:none}
.flowx-attention-item:hover,.flowx-appointment:hover{text-decoration:none;background:var(--surface-2)}
.flowx-attention-copy{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.flowx-attention-copy b,.flowx-appointment b{font-size:14px}
.flowx-attention-copy small,.flowx-appointment small{font-size:12px;color:var(--text-2);overflow-wrap:anywhere}
.flowx-attention-action{display:flex;align-items:center;gap:3px;color:var(--accent-text);font-size:12px;font-weight:750;flex:none}
.flowx-attention-action svg{width:16px;height:16px}
.flowx-appointment>span:nth-child(2){display:grid;flex:1;gap:3px;min-width:0}
.flowx-appointment>svg{width:17px;height:17px;color:var(--text-3)}
.flowx-time{min-width:60px;padding:11px 7px;text-align:center;background:var(--surface-2);border-radius:12px;font-weight:850;font-size:13px;color:var(--accent-text)}
.flowx-empty{display:grid;justify-items:center;gap:5px;background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:25px;text-align:center}
.flowx-empty>svg{color:#20AC71;width:28px;height:28px}
.flowx-empty>span{font-size:13px;color:var(--text-2)}
.flowx-coach-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.flowx-coach-actions .energy-quick{min-height:83px}
.flowx-week-header{display:flex;align-items:center;justify-content:space-between;gap:10px}
.flowx-week-header strong{font-size:14px;line-height:1.2;text-align:center}
.flowx-week-route{display:grid;gap:10px}
.flowx-route-day{display:grid;gap:8px;min-width:0}
.flowx-route-date{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:14px}
.flowx-route-date span{font-size:12px;color:var(--text-2)}
.flowx-route-today .flowx-route-date strong{color:var(--accent-text)}
.flowx-week-route .plan-list{margin:0}
.flowx-rest-label{display:block;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:12px 15px;color:var(--text-2);font-size:13px}
.flowx-plan{max-width:710px!important}
.flowx-plan>.stack{gap:14px}
.flowx-plan .flowx-progress .ring .fg{stroke:var(--accent)}
/* Focus Mode: a calm surface to log one set. All existing validation and drafts remain. */
.flowx-session{max-width:690px!important}
.flowx-session .ss-card{border-radius:23px;box-shadow:none;padding:18px}
.flowx-session .ss-ex-head h2{font-size:clamp(23px,5vw,32px);letter-spacing:-.04em}
.flowx-session .ss-plan-compact{background:var(--surface-2);border-radius:16px}
.flowx-session .set-row.active{border-color:var(--accent-border);background:var(--accent-soft);border-radius:12px}
.flowx-session .ss-main{background:#F76324;color:#fff;border-radius:15px;min-height:60px}
.flowx-session .ss-bottom{border:0;background:var(--tabbar-bg)}
@media(max-width:860px){
 :root{--tabbar-h:72px}
 main{padding-bottom:calc(100px + var(--safe-b))}
 .rail{left:10px;right:10px;bottom:max(7px,env(safe-area-inset-bottom,0px));width:auto;
   padding:6px 7px;height:65px;border:1px solid var(--line);border-radius:22px;
   box-shadow:0 10px 30px rgba(10,22,36,.15);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px)}
 .rail .nav-link{min-height:52px;font-size:11px;border-radius:15px}
 .rail .nav-link[aria-current="page"]{background:var(--accent-soft)!important;color:var(--accent-text)}
 .rail .nav-link.nav-accent[aria-current="page"] svg{box-shadow:none!important}
 .flowx-home{gap:13px}
 .flowx-focus{min-height:210px;padding:19px}
 .flowx-progress{gap:10px;padding:12px}
 .flowx-progress .ring{transform:scale(.89);transform-origin:center; margin:-6px}
 .flowx-progress-copy strong{font-size:18px}
 body[data-route="workout"] main{padding-bottom:28px}
 body:has(.mobile-thread-page) main{padding-bottom:calc(16px + var(--safe-b))}
}
@media(max-width:360px){
 .flowx-home .flowx-week{padding:5px 2px;gap:1px}
 .flowx-day{min-height:56px}.flowx-day b{font-size:14px}
 .flowx-attention-action{font-size:0}.flowx-attention-action svg{width:19px;height:19px}
 .flowx-metric-symbol{width:34px;height:34px}.flowx-metric{gap:7px;padding:9px}
 .flowx-two-metrics{gap:7px}
}
@media(prefers-reduced-motion:reduce){
 .flowx-day,.flowx-primary,.flowx-expand>summary svg,.flowx-session .ss-main{transition:none!important;animation:none!important}
 .flowx-progress .ring .fg{transition:none!important}
}
.flowx-water-setting{display:flex;align-items:center;justify-content:space-between;padding:12px 15px;border:1px solid var(--line);background:var(--surface);border-radius:15px;color:var(--text-2);font-size:13px;text-decoration:none}
.flowx-chat .flowx-metric-symbol{background:#F0EAFF;color:#7659C7}

/* Stage 8: readable actions, honest partial progress, compact coach queue. */
.flowx-primary{background:#bd400d;color:#fff}
.flowx-primary:hover{background:#a83609;color:#fff}
.flowx-primary:active{background:#962e06}
.flowx-day.partial i{background:#ab6800;box-shadow:0 0 0 2px var(--surface)}
.flow-person{border:1px solid var(--line);border-radius:18px;overflow:hidden}
.flow-person .flowx-attention-item{border:0;border-radius:0}
.flow-person-more summary{padding:10px 16px;cursor:pointer;font-size:13px}
.flowx-trainer-priority{padding:14px 18px;min-height:0}
.flowx-priority-number strong{font-size:32px}
.flow-secondary:empty,.flow-notices:empty{display:none}
.flow-notices{display:grid;gap:10px}
.route-loading{position:fixed;top:12px;left:50%;transform:translateX(-50%);z-index:60;padding:8px 18px;border-radius:30px;background:var(--surface);box-shadow:0 2px 16px #0002;font-size:14px;pointer-events:none}
.history-suggestion{font-size:12px;color:var(--text-2);padding:8px 0}


/* ===========================================================================
   Flow Stability Stage 9: one responsive system, same surfaces on all devices.
   These rules intentionally supersede legacy v5..v12 layout patches.
   =========================================================================== */
:root[data-theme="light"] {
  --brand-ring:rgba(217,71,9,.15);--bg:#F6F8FB;--surface:#fff;
  --accent:#E85719;--accent-text:#BB420C;--primary:#C94A14;
  --primary-ink:#fff;--brand-fill:#C94A14;--brand-ink:#fff;
}
:root[data-theme="dark"] {
  --brand-ring:rgba(255,121,69,.2);--bg:#101923;
  --accent:#FF8657;--accent-text:#FFAA86;--primary:#FF8657;
  --primary-ink:#16202C;--brand-fill:#FF8657;--brand-ink:#16202C;
}
/* Avoid layout shift while fonts load and growable fields overflow their grids. */
html { scroll-behavior:auto; -webkit-text-size-adjust:100%; }
body { overflow-x:clip; }
button,input,textarea,select { font:inherit; }
button,.btn,.nav-link,.auth-tab { touch-action:manipulation; }
.shell, main, .page, .stack, .row, .panel, .card, .grid-2,
.flowx-home, .flowx-focus, .flowx-route-day, .flowx-attention-item,
.flowx-two-metrics, .flowx-metric, .list-item, .field,
.auth-form, .auth-card, .auth-head { min-width:0; }
.grid-2 > *, .tiles > *, .stat-grid > *, .quick-actions > *,
.flowx-two-metrics > *, .flowx-coach-actions > * { min-width:0; }
img,video,canvas,svg { max-width:100%; }
.flowx-home .flowx-primary, .btn.primary { font-weight:700; }
.flowx-primary { background:#C94A14;color:#fff; }
.flowx-primary:hover { background:#B13F0D;color:#fff; }
.flowx-primary:active { background:#9E3409; }
/* Do not animate the whole page or create duplicate WebKit view snapshots. */
#main { view-transition-name:none!important; }
::view-transition-old(page),::view-transition-new(page) { animation:none!important; }
.page-in,.page-in-fade,.page-in-push,.page-in-pop { animation:none!important; }
@keyframes stable-page-entry { from { opacity:.93; } to { opacity:1; } }
.stable-page-enter { animation:stable-page-entry 130ms ease-out both; }
.route-loading { max-width:calc(100vw - 32px);white-space:nowrap; }
/* Login and registration: identical information architecture on Mac and iPhone. */
.auth { background:var(--bg); }
.auth-form { min-width:0; }
.auth-card { width:min(100%,440px);margin-inline:auto;gap:16px; }
.auth-card .auth-tabs { order:0; }
.auth-tabs { background:var(--surface-2);border:1px solid var(--line); }
.auth-tab { min-height:48px; font-weight:750; }
.auth-tab[aria-selected="true"] { background:var(--primary);color:var(--primary-ink);box-shadow:0 2px 7px #0001; }
.auth-card form .btn.primary { min-height:52px;width:100%; }
.auth-signup-hint { margin:0;text-align:center;color:var(--text-2);font-size:14px; }
.auth-signup-hint a { font-weight:750;color:var(--accent-text); }
.auth-static-photo { position:absolute;inset:0;z-index:-2;
  background:#121923 url('/assets/hero/1-pair-1024.webp') center / cover no-repeat; }
.auth-hero .auth-shade { z-index:-1; }
.auth-hero .brand-mark { color:#FFB694;border-color:#FFB69455;background:#FF86571C; }
.auth-kicker { color:#FFD3BA;border-color:#FDD3BA55; background:#F763241F; }
.auth-title em,.auth-hero .wordmark b { color:#FF9666; }
.auth-card .role-card,.auth-card input:not([type="checkbox"]) { max-width:100%; }
@media (min-width:861px) {
  .auth { grid-template-columns:minmax(0,1fr) minmax(380px,42%); }
  .auth-form { padding-inline:clamp(28px,5vw,72px); }
  .shell { grid-template-columns:224px minmax(0,1fr); }
  main:not(.auth):not(.welcome) { margin-inline:auto; }
  .rail { padding-right:12px;padding-left:12px; }
  .rail .nav-link { min-height:48px; }
}
@media (max-width:860px) {
  :root { --tabbar-h:76px; }
  .auth-form { padding:calc(16px + var(--safe-t)) 18px calc(30px + var(--safe-b)); }
  .auth-card { width:100%;max-width:440px; }
  .auth-card h1 { font-size:clamp(24px,6vw,30px);line-height:1.2; }
  .auth-mobile-top { min-height:48px; }
  .auth-tabs { position:relative;z-index:1; }
  main:not(.auth):not(.welcome) { padding-bottom:calc(104px + var(--safe-b)); }
  .rail { left:max(10px,var(--safe-l,0px));right:max(10px,var(--safe-r,0px));
    bottom:calc(8px + var(--safe-b));height:auto;min-height:64px;
    padding:5px 6px;border-radius:21px;
    background:var(--tabbar-bg);box-shadow:0 6px 25px #0816292a;
    display:flex;align-items:center;gap:2px; }
  .rail .nav-link { flex:1 1 0;min-width:0;min-height:54px;
    padding:5px 1px;display:flex;justify-content:center;align-items:center;
    gap:3px;font-size:clamp(10px,2.65vw,12px);line-height:1.1; }
  .rail .nav-link .nav-label { display:block;min-width:0;max-width:100%;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
  .rail .nav-link svg { height:21px;width:21px;flex-shrink:0; }
  .rail .nav-link[aria-current="page"] { background:var(--accent-soft)!important; }
  body[data-route="workout"] .rail,body:has(.mobile-thread-page) .rail { display:none; }
  body[data-route="workout"] main:not(.auth) { padding-bottom:calc(18px + var(--safe-b)); }
  .flowx-home .flowx-focus { padding:clamp(14px,4vw,21px);min-width:0; }
  .flowx-week,.flowx-two-metrics,.flowx-coach-actions { width:100%;min-width:0; }
  .flowx-two-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .flowx-coach-actions { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .ss-bottom,.flowx-session .ss-bottom { padding-bottom:calc(10px + var(--safe-b)); }
  .page-head,.toolbar,.row { min-width:0; }
  .v10-table,table { max-width:100%; }
  .table-wrap,.table-scroll { max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch; }
  .form-grid,.grid-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
  dialog { max-width:100vw; }
}
@media (max-width:390px) {
  .flowx-home { gap:11px; }
  .flowx-coach-actions .energy-quick,.flowx-coach-actions .energy-quick { font-size:12px;padding:10px 5px; }
  .rail { left:7px;right:7px;padding:4px 3px; }
  .rail .nav-link { font-size:10px; }
  .flowx-attention-copy b { white-space:normal;overflow-wrap:anywhere; }
  .grid-fields,.form-grid { grid-template-columns:minmax(0,1fr); }
}
@media (prefers-reduced-motion:reduce) {
  .stable-page-enter { animation:none!important; }
}
/* Mobile has exactly five primary destinations. The desktop-only profile link
   remains reachable via avatar/settings, not squeezed into the bottom dock. */
@media (max-width:860px) {
  .rail .nav-link.desktop-only { display:none!important; }
}

/* Flow Stage 10: no duplicate date strips, empty-day placeholders or full-row
   context-chat controls. A compact, consistent layout at 320–1440px. */
.flowx-compact-week{display:grid;gap:10px;min-width:0}
.flowx-compact-week .plan-card{margin:0;min-width:0}
.flow-booking-direct{display:flex;align-items:center;gap:12px;min-height:52px;padding:13px 16px;
  background:var(--surface);border:1px solid var(--line);border-radius:16px;
  font-weight:750;color:var(--text);text-decoration:none}
.flow-booking-direct svg:first-child{color:var(--accent-text);width:23px;height:23px}
.flow-booking-direct span{flex:1;min-width:0}
.flow-booking-direct svg:last-child{width:18px;height:18px;color:var(--text-2)}
.flow-booking-direct:focus-visible,.flow-add-athlete:focus-visible{outline:3px solid var(--primary);outline-offset:3px}
.flow-add-athlete{display:flex!important;align-items:center;justify-content:center;gap:10px;
  width:100%;min-height:56px;border-radius:16px;font-size:16px;font-weight:800;
  background:var(--primary);color:var(--primary-ink);margin-block:12px}
.flow-add-athlete svg{width:21px;height:21px}
.nutrition-head-actions{display:flex;align-items:center;gap:6px;min-width:0}
.nutrition-head-actions>.btn{white-space:nowrap;flex-shrink:0;padding:9px 10px;font-size:13px}
.nutrition-head-actions>.btn svg{width:18px;height:18px}
.nutrition-discuss{background:var(--surface);border-color:var(--line);color:var(--text)}
.notif-switch-role{width:100%;text-align:left;cursor:pointer;font:inherit;color:inherit;appearance:none;
  border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.cal-personal-block{display:flex;flex-direction:column;gap:3px;min-width:0;padding:10px 12px;
  background:var(--accent-soft);border:1px solid var(--accent-border);border-radius:12px;
  text-decoration:none;color:var(--text)}
.cal-personal-block strong{overflow-wrap:anywhere;font-size:13px}
.cal-personal-block .cal-time{font-weight:800;color:var(--accent-text)}
.cal-personal-block small{color:var(--text-2)}
@media(max-width:600px){
 .page-head:has(.nutrition-head-actions){display:flex;flex-wrap:wrap;align-items:center;gap:8px}
 .page-head:has(.nutrition-head-actions)>div:first-child{flex:1 1 100%}
 .nutrition-head-actions{flex:1 1 auto;justify-content:flex-start;max-width:100%}
 .nutrition-head-actions .nutrition-discuss{max-width:140px}
 .flow-add-athlete{min-height:54px}
}
@media(max-width:350px){.nutrition-head-actions>.btn{font-size:12px;padding-inline:8px}}
@media(prefers-reduced-motion:reduce){.flow-add-athlete,.flow-booking-direct{transition:none!important}}
/* Stage 10 screenshot review: scheduled rows should be compact and readable.
   Do not reserve an empty illustration on every entry. */
.flowx-compact-week .plan-card{display:flex;align-items:center;min-height:88px;gap:10px;padding:13px 15px 13px 20px;border-radius:17px}
.flowx-compact-week .pc-art{display:none}
.flowx-compact-week .pc-text{flex:1;min-width:0}
.flowx-compact-week .pc-text b{font-size:16px}
/* Keep controls labeled; icon-only secondary actions are not discoverable. */
.nutrition-head-actions>.btn{width:auto;min-height:42px;padding:9px 12px;gap:6px}
.nutrition-head-actions>.btn>span{position:static!important;width:auto!important;height:auto!important;
  overflow:visible!important;clip:auto!important;white-space:nowrap!important}
.nutrition-head-actions>.btn svg{flex:none}
@media(max-width:390px){.nutrition-head-actions>.btn{padding:8px 9px;font-size:12px;gap:4px}}

/* ======================================================================
   PULSE Flow Stage 11: active-set focus and iOS-safe navigation.
   One active exercise, one active set, one persistent primary action.
   ====================================================================== */
.flowx-session { width:100%; min-width:0; }
.flowx-session .ss-card { display:grid; gap:12px; overflow:visible; }
.flowx-session .ss-ex-nav { display:grid;grid-template-columns:minmax(76px,1fr) auto minmax(76px,1fr);align-items:center;gap:6px;
  padding-bottom:10px;border-bottom:1px solid var(--line); }
.flowx-session .ss-ex-nav .btn { min-width:0; min-height:44px;padding:7px 10px;gap:4px;display:inline-flex;align-items:center;justify-content:center; }
.flowx-session .ss-ex-nav .btn:last-child { justify-self:end; }
.flowx-session .ss-ex-nav .btn:first-child { justify-self:start; }
.flowx-session .ss-ex-nav svg { width:16px;height:16px;flex-shrink:0; }
.flowx-session .ss-ex-position { font-size:13px;line-height:1.3;white-space:nowrap;color:var(--text-2);font-weight:750;text-align:center; }
.flowx-session .ss-ex-head { align-items:center;gap:12px; }
.flowx-session .ss-ex-head .ss-art { width:54px;height:54px;border-radius:14px;flex-shrink:0; }
.flowx-session .ss-ex-subtitle { font-size:13px;color:var(--text-2);font-weight:600; }
.flowx-session .ss-focus-plan { font-size:13px;color:var(--text-2);padding:9px 11px;border-radius:11px;background:var(--surface-2); }
.flowx-session .ss-set-dots { display:flex;align-items:center;justify-content:flex-start;flex-wrap:wrap;gap:7px; }
.flowx-session .ss-set-dot { min-width:35px;height:35px;padding:0 9px;display:inline-flex;align-items:center;justify-content:center;
  border:1px solid var(--line);border-radius:11px;background:var(--surface-2);font-size:14px;color:var(--text-2);font-weight:750; }
.flowx-session .ss-set-dot.done { color:var(--ok);background:var(--ok-soft);border-color:color-mix(in srgb,var(--ok) 22%,transparent); }
.flowx-session .ss-set-dot.current { color:var(--accent-text);background:var(--accent-soft);border:2px solid var(--accent-border); }
.flowx-session .ss-set-dot svg { width:18px;height:18px; }
.flowx-session .ss-focus-area { display:grid;gap:10px;padding:14px 12px 12px;border:1px solid var(--accent-border);
  background:color-mix(in srgb,var(--accent-soft) 50%,var(--surface));border-radius:18px;min-width:0; }
.flowx-session .ss-focus-heading { display:flex;flex-direction:column;gap:2px; }
.flowx-session .ss-current-set { font-size:15px;letter-spacing:.015em;color:var(--accent-text); }
.flowx-session .ss-focus-table .set-head,.flowx-session .ss-focus-table .set-row,
.flowx-session .ss-history-table .set-head,.flowx-session .ss-history-table .set-row {grid-template-columns:24px minmax(0,1fr) minmax(0,1fr) 47px;gap:6px;}
.flowx-session .ss-focus-table .set-row.active { margin:0; padding:0; background:transparent; }
.flowx-session .ss-focus-table .set-in { width:100%;min-width:0; }
.flowx-session .ss-focus-table .set-check { width:47px;min-width:0; }
.flowx-session .ss-focus-table .set-steps { display:contents; }
.flowx-session .ss-focus-table .step-btn { min-height:44px; }
.flowx-session .ss-focus-table .set-err { grid-column:2 / -1; }
.flowx-session .ss-sets-detail { border:1px solid var(--line);background:var(--surface-2);border-radius:14px;padding:0 12px;min-width:0; }
.flowx-session .ss-sets-detail summary { cursor:pointer;padding:12px 0;min-height:44px;font-size:14px;font-weight:650;color:var(--text-2); }
.flowx-session .ss-history-table { padding-bottom:12px; }
.flowx-session .ss-history-table .set-row { padding:4px 0; }
.flowx-session .ss-history-table .set-in { min-width:0;width:100%; }
.flowx-session .ss-history-table .set-check { width:47px; }
.flowx-session .ss-ex-complete { display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:16px;border-radius:14px;background:var(--ok-soft);color:var(--ok); }
.flowx-session .ss-ex-complete span { flex-basis:100%;color:var(--text-2);font-size:13px; }
.flowx-session .ss-exercise-outline { margin:0 0 14px; }
.flowx-session .ss-save-detail { margin:0 0 12px; }
.flowx-session .ss-save-detail .flow-save-status { padding-bottom:10px; }
.flowx-session .ss-bottom-row { gap:0; }
.flowx-session .ss-bottom-row .ss-main { width:100%;min-width:0;max-width:620px;min-height:56px;white-space:normal;line-height:1.15;text-align:center;padding:12px 16px; }
.flowx-session .ss-rest { margin:0 0 12px; }
.flowx-session .ss-bottom { margin:0; }
.flowx-session .ss-head { flex-wrap:wrap;min-width:0; }
.flowx-session .ss-head .grow { min-width:0; }
.flowx-session .ss-head .ss-title {overflow-wrap:anywhere;}

@media(max-width:860px) {
  /* Fixed dock must never eat the final nutrition or diary item.
     Desktop retains the existing sidebar. */
  :root { --fc-nav-reserve:calc(138px + env(safe-area-inset-bottom,0px)); }
  .shell { min-height:100dvh; }
  .shell main:not(.auth):not(.welcome) { padding-bottom:var(--fc-nav-reserve); }
  body[data-route="nutrition"] #main, body[data-route="workouts"] #main,
  body[data-route="progress"] #main,body[data-route="booking"] #main {
    padding-bottom:calc(132px + env(safe-area-inset-bottom,0px));
  }
  /* Explicitly account for Safari's dynamic browser toolbar and home indicator. */
  .shell .rail {box-sizing:border-box;position:fixed;top:auto;bottom:calc(10px + env(safe-area-inset-bottom,0px));
    left:max(8px,env(safe-area-inset-left,0px));right:max(8px,env(safe-area-inset-right,0px));
    width:auto;min-height:66px;height:auto;max-height:none;z-index:60;padding:5px 6px;gap:2px;
    display:flex;align-items:center;justify-content:space-between; }
  .shell .rail .nav-link {flex:1 1 0;min-width:0;max-width:100%;padding:5px 1px;min-height:56px;
    line-height:1.15;overflow:hidden;text-align:center;}
  .shell .rail .nav-label {max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .shell .rail .nav-link.desktop-only {display:none!important;}
  /* Full-screen training: hide app tabs, reserve exactly one visible action area. */
  body[data-route="workout"] .shell .rail {display:none!important;}
  body[data-route="workout"] .shell main:not(.auth) {padding-bottom:calc(120px + env(safe-area-inset-bottom,0px));}
  .flowx-session .ss-bottom {position:fixed;z-index:65;left:0;right:0;bottom:0;margin:0;
    padding:10px max(14px,env(safe-area-inset-right,0px)) calc(11px + env(safe-area-inset-bottom,0px)) max(14px,env(safe-area-inset-left,0px));
    border-top:1px solid var(--line);border-radius:0;box-shadow:0 -6px 16px rgba(9,20,31,.06);}
  .flowx-session .ss-card {margin-bottom:14px;padding:13px 12px;gap:10px;}
  .flowx-session .ss-ex-nav {grid-template-columns:minmax(66px,1fr) auto minmax(66px,1fr);gap:3px;}
  .flowx-session .ss-ex-nav .btn {font-size:12px;padding:5px 6px;}
  .flowx-session .ss-ex-position {font-size:12px;}
  .flowx-session .ss-focus-area {padding:12px 9px;}
  .flowx-session .ss-focus-table .set-head,.flowx-session .ss-focus-table .set-row,
  .flowx-session .ss-history-table .set-head,.flowx-session .ss-history-table .set-row {grid-template-columns:22px minmax(0,1fr) minmax(0,1fr) 44px;gap:5px;}
  .flowx-session .ss-focus-table .set-check,.flowx-session .ss-history-table .set-check {width:44px;}
  .flowx-session .ss-focus-table .set-in {min-height:48px;padding-inline:4px;font-size:17px;}
  .flowx-session .ss-bottom-row .ss-main {min-height:56px;font-size:16px;}
  body[data-route="nutrition"] .meal-cards {gap:12px;min-width:0;}
  body[data-route="nutrition"] .meal-card {min-width:0;overflow-wrap:anywhere;}
  body[data-route="nutrition"] .meal-card .meal-head {min-width:0;}
  body[data-route="nutrition"] .meal-card .meal-total {white-space:nowrap;}
  body[data-route="nutrition"] .meal-card .meal-items li {min-width:0;}
}
@media(max-width:360px){
  .flowx-session .ss-ex-head .ss-art {width:46px;height:46px;}
  .flowx-session .ss-ex-nav .btn {font-size:11px;padding:3px 4px;}
  .flowx-session .ss-current-set {font-size:13px;}
  .flowx-session .ss-bottom-row .ss-main {font-size:15px;}
}
@media(prefers-reduced-motion:reduce){
  .flowx-session .ss-bottom,.flowx-session .ss-ex-nav {transition:none!important;}
}

/* Keep the secondary finish action readable in both themes. */
.flowx-session .ss-finish { background:var(--surface-2)!important;color:var(--text)!important;border:1px solid var(--line)!important;white-space:nowrap;min-height:40px;flex-shrink:0;transition:none!important; }

/* Stage 12: one calendar for coach and athlete, PULSE design tokens. */
.fc-schedule { max-width:1120px; padding-bottom:28px; }
.fc-schedule-heading {display:flex;align-items:center;justify-content:space-between;gap:14px;min-width:0;margin-bottom:16px;}
.fc-schedule-heading h1 {font-size:clamp(26px,4vw,36px);margin:2px 0 4px;letter-spacing:-.035em;}
.fc-schedule-heading .muted {font-size:13px;margin:0;}
.fc-eyebrow {font-size:11px;font-weight:800;letter-spacing:.13em;color:var(--accent-text);margin:0;}
.fc-add-main {display:flex;align-items:center;justify-content:center;gap:7px;flex-shrink:0;min-height:48px;padding:0 16px;border:0;border-radius:15px;background:var(--primary);color:var(--primary-ink);font-weight:800;cursor:pointer;}
.fc-add-main svg {width:20px;height:20px;}
.fc-schedule-body {display:grid;gap:15px;min-width:0;}
.fc-schedule-segment {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:5px;border:1px solid var(--line);border-radius:17px;background:var(--surface);gap:4px;}
.fc-schedule-segment button {min-height:43px;border:0;background:transparent;color:var(--text-2);border-radius:12px;font-size:14px;font-weight:700;cursor:pointer;}
.fc-schedule-segment button.active {background:var(--primary);color:var(--primary-ink);}
.fc-schedule-pager {display:flex;align-items:center;gap:7px;min-width:0;}
.fc-schedule-pager strong {flex:1;min-width:0;text-align:center;font-size:15px;line-height:1.3;text-transform:capitalize;}
.fc-schedule-pager button {min-height:44px;min-width:44px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--text);cursor:pointer;display:grid;place-items:center;}
.fc-schedule-pager svg {width:19px;height:19px;}
.fc-schedule-pager .fc-today {font-size:12px;padding:0 9px;font-weight:700;}
.fc-date-strip {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;padding:9px;border:1px solid var(--line);border-radius:18px;background:var(--surface);}
.fc-date {min-width:0;display:flex;flex-direction:column;align-items:center;gap:5px;padding:9px 0;border:1px solid transparent;border-radius:13px;background:transparent;color:var(--text);cursor:pointer;}
.fc-date small {font-size:11px;color:var(--text-2);text-transform:capitalize;}
.fc-date strong {font-size:18px;}
.fc-date i {font-style:normal;font-size:9px;color:var(--accent-text);height:8px;}
.fc-date.active {background:var(--accent-soft);border-color:var(--accent-border);}
.fc-date.active strong,.fc-date.active small {color:var(--accent-text);}
.fc-day-heading {display:flex;justify-content:space-between;align-items:center;gap:12px;}
.fc-day-heading h2,.fc-month-view h2 {font-size:18px;margin:4px 0;}
.fc-day-list {display:grid;gap:9px;}
.fc-event {width:100%;display:flex;align-items:center;gap:12px;text-align:left;padding:14px;border:1px solid var(--line);border-left:4px solid var(--accent);border-radius:15px;background:var(--surface);color:var(--text);cursor:pointer;min-width:0;}
.fc-event .fc-event-time {font-size:14px;font-weight:750;min-width:46px;}
.fc-event-main {display:grid;gap:3px;flex:1;min-width:0;}
.fc-event-main strong {font-size:14px;overflow-wrap:anywhere;}
.fc-event-main small {font-size:12px;color:var(--text-2);}
.fc-event svg {width:17px;height:17px;color:var(--text-3);}
.fc-event-group,.fc-week-event.fc-event-group,.fc-timeline-event.fc-event-group {border-left-color:var(--carbs);}
.fc-event-block,.fc-week-event.fc-event-block,.fc-timeline-event.fc-event-block {border-left-color:var(--warn);}
.fc-event-booking,.fc-week-event.fc-event-booking,.fc-timeline-event.fc-event-booking {border-left-color:var(--ok);}
.fc-empty {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:35px 12px;color:var(--text-2);text-align:center;}
.fc-empty strong {color:var(--text);}
.fc-empty svg {width:24px;height:24px;}
.fc-time-details {margin-top:14px;border:1px solid var(--line);border-radius:14px;background:var(--surface);overflow:hidden;}
.fc-time-details summary {cursor:pointer;padding:15px;color:var(--text-2);font-size:13px;font-weight:700;}
.fc-time-grid {position:relative;margin:0 12px 16px 0;min-height:960px;}
.fc-timeline {display:grid;grid-template-rows:repeat(16,60px);}
.fc-hour {display:grid;grid-template-columns:55px 1fr;align-items:start;}
.fc-hour span {text-align:center;color:var(--text-3);font-size:11px;}
.fc-hour>div {border-top:1px solid var(--line);}
.fc-time-overlays {position:absolute;inset:0 0 0 55px;pointer-events:none;}
.fc-timeline-event {position:absolute;left:7px;right:0;pointer-events:auto;display:flex;flex-direction:column;gap:4px;padding:9px;border:1px solid var(--line);border-left:4px solid var(--accent);border-radius:9px;background:var(--surface-2);color:var(--text);text-align:left;overflow:hidden;cursor:pointer;}
.fc-timeline-event strong {font-size:12px;}
.fc-timeline-event small {font-size:11px;color:var(--text-2);}
.fc-week-scroll {display:grid;grid-template-columns:repeat(7,minmax(110px,1fr));gap:7px;min-width:0;}
.fc-week-col {display:flex;flex-direction:column;gap:8px;padding:7px;border:1px solid var(--line);border-radius:14px;background:var(--surface);min-height:190px;}
.fc-week-date {min-height:42px;border:0;border-radius:10px;background:transparent;color:var(--text);font-size:12px;font-weight:700;cursor:pointer;}
.fc-week-date.active {background:var(--accent-soft);color:var(--accent-text);}
.fc-week-event {display:grid;gap:5px;width:100%;padding:10px 7px;border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:9px;background:var(--surface-2);color:var(--text);text-align:left;cursor:pointer;}
.fc-week-event strong {font-size:11px;overflow-wrap:anywhere;}
.fc-week-event small {font-size:10px;color:var(--text-2);}
.fc-week-add {margin-top:auto;border:1px dashed var(--line-strong);border-radius:9px;min-height:38px;background:transparent;color:var(--text-2);cursor:pointer;}
.fc-month-view {display:grid;gap:13px;}
.fc-month-weekdays,.fc-month-grid {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;}
.fc-month-weekdays span {text-align:center;color:var(--text-2);font-size:12px;}
.fc-month-date,.fc-month-blank {min-height:67px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--text);padding:8px 2px;display:flex;align-items:center;flex-direction:column;gap:8px;cursor:pointer;}
.fc-month-date.active {border-color:var(--accent-border);background:var(--accent-soft);color:var(--accent-text);}
.fc-month-date strong {font-size:14px;}
.fc-month-dots {display:flex;gap:3px;}
.fc-month-dots i {width:6px;height:6px;border-radius:50%;background:var(--accent);}
.fc-month-dots .fc-dot-group {background:var(--carbs);}
.fc-month-dots .fc-dot-external {background:var(--text-3);}
.fc-month-dots .fc-dot-block {background:var(--warn);}
.fc-month-dots .fc-dot-booking {background:var(--ok);}
.fc-month-blank {visibility:hidden;}
.fc-schedule-tools {display:flex;flex-wrap:wrap;gap:8px;}
.fc-schedule-tools .btn {font-size:12px;min-height:44px;}
.fc-booking-slots {display:grid;gap:12px;}
.fc-booking-slots h2 {margin:0;}
.fc-slot-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(88px,1fr));gap:8px;}
.fc-slot {min-height:46px;border:1px solid var(--accent-border);border-radius:12px;background:var(--accent-soft);color:var(--text);font-weight:750;cursor:pointer;}
.fc-booking-manage {display:flex;align-items:center;justify-content:space-between;min-height:44px;color:var(--accent-text);font-size:13px;font-weight:700;}
.fc-action-list {gap:8px;}
.fc-action-option {width:100%;display:flex;align-items:center;justify-content:space-between;min-height:52px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);color:var(--text);padding:12px 14px;font-weight:650;text-align:left;cursor:pointer;}
.fc-ok {color:var(--ok);}
@media(max-width:860px){
 .fc-schedule {padding-bottom:calc(145px + env(safe-area-inset-bottom,0px));}
 .fc-week-view {overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;}
 .fc-week-scroll {min-width:850px;}
 .fc-schedule-heading h1 {font-size:28px;}
 .fc-schedule-heading .muted {max-width:240px;}
 .fc-add-main {padding:0 12px;}
}
@media(max-width:360px){
 .fc-schedule-heading h1 {font-size:25px;}
 .fc-schedule-heading .muted {font-size:11px;}
 .fc-date-strip {padding:6px;gap:1px;}
 .fc-date {padding:7px 0;}
 .fc-date strong {font-size:16px;}
 .fc-schedule-pager strong {font-size:13px;}
 .fc-schedule-pager button {min-width:40px;}
 .fc-month-date {min-height:56px;}
}
/* Numeric iPhone keyboard; advanced plans via explicit one-tap presets. */
.fc-reps-presets {display:flex;flex-wrap:wrap;gap:7px;margin:0 0 8px 0;}
.fc-reps-preset {min-height:40px;min-width:62px;padding:8px 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2);color:var(--text-2);font-size:12px;font-weight:700;cursor:pointer;}
.fc-reps-preset:active {background:var(--accent-soft);color:var(--accent-text);}
/* Explicit icon dimensions prevent flex SVG from expanding to 200px on iPhone. */
.fc-booking-manage svg,.fc-action-option svg {width:18px;height:18px;flex:0 0 18px;}
/* Avoid inherited light-theme button colors in the dark schedule toolbar. */
.fc-schedule-tools .btn {background:var(--surface-2)!important;color:var(--text)!important;border:1px solid var(--line)!important;box-shadow:none;}
.fc-schedule-tools .btn:focus-visible {outline:2px solid var(--accent);outline-offset:2px;}
.fc-schedule-tools .fc-tool-button {display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 13px;border-radius:13px;border:1px solid var(--line);background:var(--surface-2);color:var(--text);font:inherit;font-size:12px;font-weight:700;text-decoration:none;cursor:pointer;}
.fc-schedule-tools .fc-tool-button:focus-visible {outline:2px solid var(--accent);outline-offset:2px;}

/* Stage 12B — booking picker based on the supplied reference: one calendar, one time, one action. */
.fc-pick{max-width:680px;display:grid;gap:16px;padding-bottom:calc(170px + env(safe-area-inset-bottom,0px));}
.fc-pick-head{display:flex;align-items:center;gap:10px;min-height:52px;}
.fc-pick-head h1{margin:0;font-size:clamp(20px,5vw,26px);font-weight:800;line-height:1.2;letter-spacing:-.03em;}
.fc-pick-back,.fc-pick-pager button{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;border:0;border-radius:50%;background:var(--surface-2);color:var(--text);cursor:pointer;}
.fc-pick-back svg,.fc-pick-pager svg{width:22px;height:22px;}
.fc-pick-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:5px;background:var(--surface-2);border-radius:17px;}
.fc-pick-tabs button{min-height:45px;border:0;border-radius:13px;background:transparent;color:var(--text-2);font:inherit;font-weight:750;cursor:pointer;}
.fc-pick-tabs button.active{background:var(--accent-soft);color:var(--accent-text);box-shadow:inset 0 0 0 1px var(--accent-border);}
.fc-pick-pager{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.fc-pick-pager strong{font-size:19px;font-weight:800;text-transform:capitalize;text-align:center;letter-spacing:-.02em;}
.fc-pick-calendar{display:grid;gap:12px;}
.fc-pick-weekdays,.fc-pick-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;}
.fc-pick-weekdays span{text-align:center;font-size:12px;font-weight:700;color:var(--text-2);}
.fc-pick-day,.fc-pick-blank{display:grid;place-items:center;min-width:0;aspect-ratio:1 / 1;min-height:40px;border:1px solid transparent;border-radius:13px;background:var(--surface-2);color:var(--text);font:inherit;font-size:15px;font-weight:750;cursor:pointer;}
.fc-pick-blank{visibility:hidden;}
.fc-pick-day.fc-pick-available{background:color-mix(in srgb,var(--ok) 13%,var(--surface));color:var(--text);}
.fc-pick-day.fc-pick-busy{background:color-mix(in srgb,var(--warn) 14%,var(--surface));color:var(--text);}
.fc-pick-day.fc-pick-off{background:var(--surface-2);color:var(--text-3);}
.fc-pick-day.active{background:var(--primary)!important;color:var(--primary-ink)!important;box-shadow:0 0 0 2px var(--accent-border);}
.fc-pick-legend{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;color:var(--text-2);font-size:11px;}
.fc-pick-legend span{display:flex;align-items:center;gap:6px;white-space:nowrap;}
.fc-pick-key{width:11px;height:11px;display:inline-block;border-radius:4px;background:var(--surface-2);}
.fc-pick-key.fc-pick-available{background:var(--ok);}.fc-pick-key.fc-pick-busy{background:var(--warn);}.fc-pick-key.fc-pick-off{background:var(--text-3);}
.fc-pick-selected-title{font-size:19px;margin:10px 0 0;text-transform:capitalize;letter-spacing:-.02em;}
.fc-pick-time-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;}
.fc-pick-time{min-width:0;min-height:50px;border:1px solid var(--line);border-radius:13px;background:var(--surface);color:var(--text);font:inherit;font-weight:750;cursor:pointer;}
.fc-pick-time.selected{background:var(--primary);border-color:var(--primary);color:var(--primary-ink);}
.fc-pick-time:disabled{opacity:.35;cursor:not-allowed;text-decoration:line-through;}
.fc-pick-empty{font-size:14px;color:var(--text-2);margin:5px 0;}
.fc-pick-slots{min-height:50px;}
.fc-pick-group{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;text-align:left;padding:14px;border:1px solid var(--line);border-radius:13px;background:var(--surface);color:var(--text);cursor:pointer;margin-bottom:8px;}
.fc-pick-group>span:first-child{display:grid;gap:5px;}.fc-pick-group strong{font-size:14px;}.fc-pick-group small{color:var(--text-2);font-size:12px;}
.fc-pick-group.selected{border-color:var(--accent);background:var(--accent-soft);}.fc-pick-group:disabled{opacity:.5;cursor:not-allowed;}
.fc-pick-group-tag{font-size:11px;font-weight:700;white-space:nowrap;}
.fc-pick-manage{display:flex;align-items:center;justify-content:space-between;min-height:44px;color:var(--accent-text);font-size:13px;font-weight:750;text-decoration:none;}
.fc-pick-manage svg{width:18px;height:18px;}
.fc-pick-foot{position:sticky;bottom:calc(var(--tabbar-h) + var(--safe-b) + 12px);z-index:6;display:grid;padding:10px 0;background:var(--bg);}
.fc-pick-cta{width:100%;min-height:54px;border:0;border-radius:17px;background:var(--primary);color:var(--primary-ink);font:inherit;font-size:16px;font-weight:850;cursor:pointer;}
.fc-pick-cta:disabled{background:var(--surface-2);color:var(--text-3);cursor:not-allowed;}
.fc-pick :is(button,a):focus-visible{outline:3px solid var(--accent);outline-offset:2px;}
@media(max-width:360px){.fc-pick{gap:12px;}.fc-pick-day{min-height:35px;font-size:13px;border-radius:10px;}.fc-pick-time-grid{gap:6px;}.fc-pick-time{font-size:13px;}.fc-pick-head h1{font-size:20px;}}
@media(min-width:861px){.fc-pick{padding-bottom:40px;}.fc-pick-foot{bottom:10px;}}
@media(prefers-reduced-motion:reduce){.fc-pick *{scroll-behavior:auto!important;transition:none!important;}}
/* The confirmation must never cover the second row of times on iPhone. */
@media(max-width:860px){
 .fc-pick{padding-bottom:calc(var(--tabbar-h) + var(--safe-b) + 40px);}
 .fc-pick-foot{position:relative;bottom:auto;z-index:1;background:transparent;padding:8px 0 0;}
}
/* Compact mobile rhythm: both time rows and CTA fit above the tabbar on common iPhones. */
@media(max-width:860px){
 .fc-pick{gap:10px;}
 .fc-pick-head{min-height:44px;}
 .fc-pick-tabs button{min-height:42px;}
 .fc-pick-pager button{height:40px;width:40px;flex-basis:40px;}
 .fc-pick-calendar{gap:7px;}
 .fc-pick-weekdays,.fc-pick-days{gap:4px;}
 .fc-pick-day,.fc-pick-blank{aspect-ratio:auto;height:42px;min-height:0;}
 .fc-pick-selected-title{margin:2px 0 0;}
 .fc-pick-time-grid{gap:6px;}
 .fc-pick-time{min-height:44px;}
 .fc-pick-manage{min-height:36px;}
 .fc-pick-cta{min-height:50px;}
}
