/* ==========================================================================
   PULSE (v13) — дизайн-система по утверждённым макетам.
   Подключается ПОСЛЕ styles.css: переопределяет токены (старые экраны v12
   автоматически получают новую палитру) и добавляет компоненты p-*.
   Цвета сняты с референсов (Архив.zip) и Figma-кита; см. docs/DESIGN_TOKENS_V13.md.
   ========================================================================== */

:root[data-theme="light"], :root:not([data-theme]) {
  --p-bg: #F4F7FE;
  --p-bg-grad: radial-gradient(140% 70% at 50% -10%, #FFFFFF 0%, #F5F8FE 55%, #EEF2FD 100%);
  --p-card: #FFFFFF;
  --p-card-2: #F7F9FE;
  --p-raised: #EEF2FD;
  --p-raised-2: #E4E9FB;
  --p-line: #E6EAF6;
  --p-line-strong: #D5DCF0;
  --p-shadow: 0 1px 2px rgba(30, 40, 90, .04), 0 8px 24px rgba(40, 56, 120, .07);
  --p-shadow-lg: 0 18px 44px rgba(40, 56, 120, .14);
  --p-text: #12173A;
  --p-text-2: #5E6688;
  --p-text-3: #626A8A;
  --p-accent2: #5A6A1D;           /* вторая строка заголовка «Общий импульс.» */
  --p-lime: #DCFB7C;
  --p-lime-2: #D3F55F;
  --p-lime-soft: #EEFCC6;
  --p-lime-ink: #111406;
  --p-lime-text: #4D6311;         /* лаймовые слова на светлом фоне — тёмная олива для контраста */
  --p-blue: #4E5DF2;
  --p-blue-2: #6B7BFA;
  --p-blue-soft: #E3E9FF;
  --p-blue-ink: #FFFFFF;
  --p-blue-text: #3D4BDF;
  --p-lav: #BDB6F3;
  --p-lav-soft: #ECEEFF;
  --p-lav-text: #5948C9;
  --p-out: #DDE1FD;               /* исходящие сообщения */
  --p-out-ink: #12173A;
  --p-in: #FFFFFF;
  --p-protein: #C7F24F;
  --p-fat: #C3A2FB;
  --p-carbs: #75A0FB;
  --p-water: #7BBEFE;
  --p-ok: #2B7D45;  --p-ok-bg: #E7F9DC;  --p-ok-line: #CFEFB7;
  --p-warn: #9B620D; --p-warn-bg: #FFF2D7;
  --p-danger: #C1364E; --p-danger-bg: #FDE7EB;
  --p-lunch: #FEF3DD;  --p-lunch-ink: #8A5A12;  --p-lunch-ico: #F2D7A2;
  --p-drive: #E5EAFD;  --p-drive-ink: #26307C;  --p-drive-ico: #C9D2FA;
  --p-break: #E5F7EC;  --p-break-ink: #1E6A42;  --p-break-ico: #BFE8CF;
  --p-personal: #FDE4F5; --p-personal-ink: #8E2370; --p-personal-ico: #F6C3E7;
  --p-month-card: #FFFFFF;
  --p-month-ink: #12173A;
  --p-month-muted: #A1A8C2;
  --p-hero-a: #E8ECFF; --p-hero-b: #D6DEFF;     /* hero тренировки спортсмена */
  --p-hero-ink: #12173A; --p-hero-sub: #4B5482;
  --p-tr-hero-a: #E2E8FD; --p-tr-hero-b: #D3DCFB;
  --p-prio-1: linear-gradient(135deg, #F1FDCB 0%, #E5FA9F 100%);
  --p-prio-1-ink: #12173A;
  --p-prio-2: linear-gradient(135deg, #F0F1FF 0%, #E3E6FD 100%);
  --p-kpi-lime: linear-gradient(135deg, #EFFCC4, #E2F89E);
  --p-kpi-lav: linear-gradient(135deg, #F1F2FF, #E5E8FE);
  --p-nav-bg: rgba(255, 255, 255, .96);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --p-bg: #0F1524;
  --p-bg-grad: radial-gradient(130% 60% at 50% -10%, #1A2347 0%, #111829 55%, #0D1220 100%);
  --p-card: #1A2237;
  --p-card-2: #1F2840;
  --p-raised: #252F4B;
  --p-raised-2: #2E3858;
  --p-line: #2A3452;
  --p-line-strong: #36416A;
  --p-shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 10px 30px rgba(0, 0, 0, .25);
  --p-shadow-lg: 0 20px 50px rgba(0, 0, 0, .45);
  --p-text: #F4F6FF;
  --p-text-2: #A8B1CC;
  --p-text-3: #9AA3BF;
  --p-accent2: #DCFB7C;
  --p-lime: #DCFB7C;
  --p-lime-2: #D3F66A;
  --p-lime-soft: #D9FA7B;
  --p-lime-ink: #10140A;
  --p-lime-text: #DCFB7C;
  --p-blue: #4A60FB;
  --p-blue-2: #7A90FF;
  --p-blue-soft: #263066;
  --p-blue-ink: #FFFFFF;
  --p-blue-text: #8FA0FF;
  --p-lav: #BCB9FB;
  --p-lav-soft: #C4C8FF;
  --p-lav-text: #C6C2FF;
  --p-out: #CBC5FC;
  --p-out-ink: #12173A;
  --p-in: #2B3554;
  --p-protein: #DFFC86;
  --p-fat: #B49FFC;
  --p-carbs: #779CFC;
  --p-water: #7BBEFE;
  --p-ok: #B6E78F;  --p-ok-bg: rgba(182, 231, 143, .12);  --p-ok-line: rgba(182, 231, 143, .35);
  --p-warn: #F4C66F; --p-warn-bg: rgba(244, 198, 111, .14);
  --p-danger: #F59AA8; --p-danger-bg: rgba(245, 154, 168, .14);
  --p-lunch: #FDF0D6;  --p-lunch-ink: #6B4710;  --p-lunch-ico: #F3DAA6;
  --p-drive: #C9D3FB;  --p-drive-ink: #1E2770;  --p-drive-ico: #AEBBF6;
  --p-break: #CDEFD9;  --p-break-ink: #174F31;  --p-break-ico: #A9E0BE;
  --p-personal: #F5CDEA; --p-personal-ink: #6F1956; --p-personal-ico: #EBAFD9;
  --p-month-card: linear-gradient(160deg, #5D6CF5 0%, #4552E3 55%, #3B47D0 100%);
  --p-month-ink: #FFFFFF;
  --p-month-muted: rgba(255, 255, 255, .45);
  --p-hero-a: #5468F8; --p-hero-b: #3C4FE8;
  --p-hero-ink: #FFFFFF; --p-hero-sub: rgba(255, 255, 255, .78);
  --p-tr-hero-a: #2C3A86; --p-tr-hero-b: #1F2A63;
  --p-prio-1: linear-gradient(135deg, #E1FC86 0%, #D3F664 100%);
  --p-prio-1-ink: #10140A;
  --p-prio-2: linear-gradient(135deg, #C8C6FD 0%, #B6B3F7 100%);
  --p-kpi-lime: linear-gradient(135deg, #E1FC86, #D2F563);
  --p-kpi-lav: linear-gradient(135deg, #CFCFFF, #BDBBF8);
  --p-nav-bg: rgba(22, 29, 48, .96);
  color-scheme: dark;
}

/* ---- старые экраны v12 получают палитру Pulse через свои токены ---- */
:root[data-theme="light"], :root[data-theme="dark"] {
  --bg: var(--p-bg);
  --bg-glow: transparent;
  --surface: var(--p-card);
  --surface-2: var(--p-raised);
  --surface-3: var(--p-raised-2);
  --line: var(--p-line);
  --line-strong: var(--p-line-strong);
  --text: var(--p-text);
  --text-2: var(--p-text-2);
  --text-3: var(--p-text-3);
  --accent: var(--p-blue);
  --accent-text: var(--p-blue-text);
  --accent-soft: var(--p-blue-soft);
  --accent-border: color-mix(in srgb, var(--p-blue) 35%, transparent);
  --primary: var(--p-lime);
  --primary-ink: var(--p-lime-ink);
  --brand-fill: var(--p-lime);
  --brand-ink: var(--p-lime-ink);
  --brand-ring: color-mix(in srgb, var(--p-lime) 45%, transparent);
  --bubble: var(--p-out);
  --bubble-ink: var(--p-out-ink);
  --protein: var(--p-protein);
  --fat: var(--p-fat);
  --carbs: var(--p-carbs);
  --ok: var(--p-ok);
  --ok-soft: var(--p-ok-bg);
  --warn: var(--p-danger);
  --warn-soft: var(--p-danger-bg);
  --track: var(--p-raised);
  --tabbar-bg: var(--p-nav-bg);
  --shadow: var(--p-shadow-lg);
  --skeleton: var(--p-raised);
  --skeleton-hi: var(--p-card-2);
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 24px;
}

body { background-color: var(--p-bg); background-image: var(--p-bg-grad); background-attachment: fixed; color: var(--p-text); font-feature-settings: "cv11", "ss01"; }

/* ===================== каркас: боковое меню (desktop) / нижнее (mobile) ===================== */
.shell { grid-template-columns: 252px minmax(0, 1fr); }
.rail { background: var(--p-card); border-right: 1px solid var(--p-line); padding: 22px 14px; gap: 4px; }
.rail .brand { padding: 4px 10px 18px; }
.rail .brand-mark { display: none; }
.nav-link { position: relative; min-height: 48px; padding: 10px 14px; border-radius: 16px; color: var(--p-text-2); font-weight: 600; font-size: 15px; transition: background var(--p-t, .18s) ease, color .18s ease, transform .18s ease; }
.nav-link svg { width: 22px; height: 22px; }
.nav-link:hover { background: var(--p-raised); color: var(--p-text); text-decoration: none; }
.nav-link[aria-current="page"], .nav-link.nav-accent[aria-current="page"] { background: var(--p-lime); color: var(--p-lime-ink); box-shadow: none; }
.nav-link[aria-current="page"] svg, .nav-link.nav-accent[aria-current="page"] svg { color: var(--p-lime-ink); }
.nav-link.nav-accent { margin-bottom: 0; background: transparent; color: var(--p-text-2); font-weight: 600; box-shadow: none; }
.nav-link.nav-accent svg { color: currentColor; }
.nav-link.nav-accent::after { display: none; }
@media (hover: hover) { .nav-link.nav-accent:hover { background: var(--p-raised); color: var(--p-text); filter: none; } }
.nav-link .badge { background: var(--p-lav); color: #1B1650; }
.rail-foot { border-radius: 16px; }
.rail-foot:hover { background: var(--p-raised); }
main { max-width: 1240px; }
main:has(.p-page) { padding-top: calc(18px + var(--safe-t)); }

@media (max-width: 860px) {
  :root { --tabbar-h: 76px; }
  main { padding: calc(10px + var(--safe-t)) 16px calc(var(--tabbar-h) + 26px + var(--safe-b)); }
  main:has(.p-page) { padding-top: calc(10px + var(--safe-t)); }
  .rail {
    left: 10px; right: 10px; bottom: calc(8px + var(--safe-b)); inset-inline: 10px;
    padding: 8px; gap: 2px; border: 1px solid var(--p-line); border-radius: 28px;
    background: var(--p-nav-bg); box-shadow: 0 10px 34px rgba(20, 30, 80, .14);
  }
  :root[data-theme="dark"] .rail { box-shadow: 0 10px 34px rgba(0, 0, 0, .45); }
  .nav-link, .nav-link.nav-accent { min-height: 60px; border-radius: 22px; gap: 4px; padding: 6px 2px; font-size: 11.5px; font-weight: 600; color: var(--p-text-2); flex-grow: 1; }
  .nav-link svg, .nav-link.nav-accent svg { width: 24px; height: 24px; padding: 0; background: none; border-radius: 0; box-shadow: none !important; color: currentColor; }
  .nav-link[aria-current="page"], .nav-link.nav-accent[aria-current="page"] { background: var(--p-lime) !important; color: var(--p-lime-ink); font-weight: 700; }
  .nav-link[aria-current="page"] svg, .nav-link.nav-accent[aria-current="page"] svg { color: var(--p-lime-ink); }
  .nav-link.nav-accent .nav-label { font-weight: inherit; }
  .nav-link .badge { top: 4px; left: calc(50% + 8px); }
  #toast { bottom: calc(var(--tabbar-h) + 22px + var(--safe-b)); }
  .shell .rail { height: auto; padding: 7px; border-radius: 28px; border-color: var(--p-line); background: var(--p-nav-bg); }
  .shell .rail .nav-link { min-height: 60px; padding: 6px 1px; border-radius: 22px; font-size: clamp(10.5px, 2.8vw, 12px); gap: 4px; flex-direction: column; color: var(--p-text-2); }
  .shell .rail .nav-link svg { width: 24px; height: 24px; }
  .shell .rail .nav-link[aria-current="page"], .shell .rail .nav-link.nav-accent[aria-current="page"] { background: var(--p-lime) !important; color: var(--p-lime-ink) !important; }
  .shell .rail .nav-link[aria-current="page"] svg { color: var(--p-lime-ink) !important; }
  .shell .rail .nav-link[aria-current="page"] .nav-label { font-weight: 750; }
  main { padding-bottom: calc(var(--tabbar-h) + 30px + var(--safe-b)) !important; }
  html.kb-open .rail { display: none; }
  body.p-fullscreen .rail { display: none; }
  body.p-fullscreen main { padding-bottom: calc(16px + var(--safe-b)); }
}

/* ===================== типографика и общие элементы ===================== */
.p-page { --gap: 12px; display: grid; gap: var(--gap); width: 100%; min-width: 0; }
.p-page > * { min-width: 0; }
.p-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--p-text-2); }
.p-display { margin: 2px 0 0; font-size: 34px; line-height: 1.08; font-weight: 800; letter-spacing: -.03em; color: var(--p-text); }
.p-display .p-accent { display: block; color: var(--p-accent2); }
.p-h1 { font-size: 30px; line-height: 1.12; font-weight: 800; letter-spacing: -.03em; margin: 0; }
.p-h2 { font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.p-h3 { font-size: 17px; line-height: 1.3; font-weight: 650; margin: 0; }
.p-sub { color: var(--p-text-2); font-size: 14px; line-height: 1.4; }
.p-cap { color: var(--p-text-2); font-size: 12.5px; line-height: 1.35; }
.p-num { font-variant-numeric: tabular-nums; }
.p-kpi-num { font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.p-muted { color: var(--p-text-2); }
.p-link { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--p-blue-text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 32px; }
.p-link svg { width: 18px; height: 18px; }
.p-link:hover { text-decoration: none; filter: brightness(1.1); }
.p-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.p-row.between { justify-content: space-between; }
.p-grow { flex: 1 1 auto; min-width: 0; }
.p-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.p-section-head h2 { font-size: 20px; font-weight: 750; letter-spacing: -.02em; margin: 0; }
.p-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- шапка с брендом ---- */
.p-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.p-brand { display: inline-flex; align-items: flex-start; gap: 0; text-decoration: none !important; color: var(--p-text); font-size: 23px; font-weight: 800; letter-spacing: -.035em; line-height: 1; }
.p-brand b { font-weight: 800; }
.p-brand .c { background: linear-gradient(90deg, #4E5DF2, #7B5CF5); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="dark"] .p-brand .c { background: linear-gradient(90deg, #8CA0FF, #B4A4FF); -webkit-background-clip: text; background-clip: text; }
.p-brand small { font-size: 9.5px; font-weight: 800; letter-spacing: .18em; color: var(--p-blue-text); margin: 4px 0 0 7px; }
.p-top-actions { display: flex; align-items: center; gap: 10px; }
.p-iconbtn { position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--p-raised); color: var(--p-text); cursor: pointer; transition: transform .15s ease, background .15s ease; }
.p-iconbtn:hover { background: var(--p-raised-2); }
.p-iconbtn:active { transform: scale(.94); }
.p-iconbtn svg { width: 22px; height: 22px; }
.p-iconbtn.plain { background: transparent; }
.p-iconbtn.plain:hover { background: var(--p-raised); }
.p-iconbtn.sm { width: 36px; height: 36px; }
.p-iconbtn.sm svg { width: 18px; height: 18px; }
.p-iconbtn .p-dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--p-lime-2); box-shadow: 0 0 0 2px var(--p-raised); }
.p-iconbtn .badge { position: absolute; top: -2px; right: -2px; }
.p-backbar { display: flex; align-items: center; gap: 10px; min-height: 56px; }
.p-backbar .p-h2 { font-size: 22px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- аватары ---- */
.p-ava { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--p-blue); color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .01em; user-select: none; }
.p-ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.p-ava.xs { width: 32px; height: 32px; font-size: 12px; }
.p-ava.sm { width: 40px; height: 40px; font-size: 13px; }
.p-ava.md { width: 48px; height: 48px; font-size: 16px; }
.p-ava.lg { width: 56px; height: 56px; font-size: 18px; }
.p-ava.xl { width: 64px; height: 64px; font-size: 20px; }
.p-ava.c-blue { background: var(--p-blue); color: #fff; }
.p-ava.c-lime { background: var(--p-lime); color: var(--p-lime-ink); }
.p-ava.c-lav { background: var(--p-lav-soft); color: var(--p-lav-text); }
.p-ava.c-peach { background: #F6B08A; color: #4A2410; }
.p-ava.c-soft { background: var(--p-blue-soft); color: var(--p-blue-text); }
:root[data-theme="dark"] .p-ava.c-lav { background: #C4C3FF; color: #262374; }
.p-ava-wrap { position: relative; flex: none; }
.p-presence { position: absolute; right: 0; bottom: 0; width: 15px; height: 15px; border-radius: 50%; background: #9BE54A; box-shadow: 0 0 0 3px var(--p-card); }
.p-ava-ring { padding: 3px; border-radius: 50%; background: linear-gradient(135deg, var(--p-blue-2), var(--p-lav)); }
.p-ava-ring .p-ava { box-shadow: 0 0 0 3px var(--p-card); }

/* ---- карточки ---- */
.p-card { position: relative; min-width: 0; background: var(--p-card); border: 1px solid var(--p-line); border-radius: 24px; padding: 18px; box-shadow: var(--p-shadow); }
:root[data-theme="dark"] .p-card { box-shadow: none; }
.p-card.tight { padding: 14px; }
.p-card.flat { box-shadow: none; }
.p-card.soft { background: var(--p-card-2); }
.p-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.p-card-head h3, .p-card-head .p-h3 { font-size: 17px; font-weight: 700; margin: 0; }
.p-tap { cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; text-align: left; font: inherit; color: inherit; }
.p-tap:hover { box-shadow: var(--p-shadow-lg); }
.p-tap:active { transform: scale(.985); }
button.p-card { width: 100%; }
.p-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.p-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.p-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }

/* ---- кнопки ---- */
.p-btn { --h: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--h); padding: 0 18px; border: 1px solid transparent; border-radius: 16px; font: inherit; font-size: 15px; font-weight: 650; line-height: 1.15; text-align: center; cursor: pointer; text-decoration: none !important; white-space: nowrap; background: var(--p-raised); color: var(--p-text); transition: transform .14s ease, filter .14s ease, background .14s ease, box-shadow .14s ease; touch-action: manipulation; }
.p-btn svg { width: 20px; height: 20px; flex: none; }
.p-btn:hover { filter: brightness(1.03); }
.p-btn:active:not(:disabled) { transform: scale(.97); }
.p-btn:disabled { opacity: .55; cursor: not-allowed; }
.p-btn[aria-busy="true"] { position: relative; color: transparent !important; }
.p-btn[aria-busy="true"]::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--p-text) transparent var(--p-text) transparent; animation: p-spin .7s linear infinite; }
.p-btn.lime { background: var(--p-lime); color: var(--p-lime-ink); box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--p-lime-2) 90%, transparent); }
.p-btn.blue { background: var(--p-blue); color: #fff; }
.p-btn.blue-soft { background: var(--p-blue-soft); color: var(--p-blue-text); }
:root[data-theme="dark"] .p-btn.blue-soft { background: #3F4DC8; color: #fff; }
.p-btn.surface { background: var(--p-card); border-color: var(--p-line); color: var(--p-text); }
:root[data-theme="dark"] .p-btn.surface { background: var(--p-raised); border-color: var(--p-line-strong); }
.p-btn.outline { background: transparent; border-color: var(--p-line-strong); color: var(--p-text); }
:root[data-theme="light"] .p-btn.outline { border-color: #C9CFEA; }
.p-btn.white { background: #fff; color: #12173A; }
.p-btn.dashed { background: transparent; border: 1.5px dashed color-mix(in srgb, var(--p-lime-2) 85%, #7C9A1A); color: var(--p-text); }
:root[data-theme="dark"] .p-btn.dashed { border-color: var(--p-lime); color: var(--p-lime); }
.p-btn.danger { background: var(--p-danger-bg); color: var(--p-danger); }
.p-btn.ghost { background: transparent; color: var(--p-text-2); }
.p-btn.sm { --h: 38px; padding: 0 14px; font-size: 13.5px; border-radius: 13px; }
.p-btn.sm svg { width: 17px; height: 17px; }
.p-btn.lg { --h: 56px; font-size: 16.5px; border-radius: 20px; }
.p-btn.block { width: 100%; }
.p-btn .p-plus-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--p-lime-ink); color: var(--p-lime); }
.p-btn.outline .p-plus-dot { background: var(--p-text); color: var(--p-card); }
:root[data-theme="dark"] .p-btn.outline .p-plus-dot { background: #fff; color: #1A2237; }
.p-btn .p-plus-dot svg { width: 16px; height: 16px; }
.p-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.p-actions .p-btn { padding: 0 10px; min-width: 0; }
.p-actions .p-btn span { overflow: hidden; text-overflow: ellipsis; }

/* ---- чипы, сегменты, вкладки ---- */
.p-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 3px 10px; border-radius: 9px; font-size: 12.5px; font-weight: 600; line-height: 1.2; background: var(--p-raised); color: var(--p-text-2); white-space: nowrap; }
.p-chip.blue { background: var(--p-blue-soft); color: var(--p-blue-text); }
:root[data-theme="dark"] .p-chip.blue { background: #3843A8; color: #DDE2FF; }
.p-chip.lime { background: var(--p-lime-soft); color: #36450A; }
:root[data-theme="dark"] .p-chip.lime { background: var(--p-lime); color: #1B2408; }
.p-chip.lav { background: var(--p-lav-soft); color: var(--p-lav-text); }
.p-chip.ok { background: var(--p-ok-bg); color: var(--p-ok); border: 1px solid var(--p-ok-line); border-radius: 999px; padding: 4px 12px; }
.p-chip.warn { background: var(--p-warn-bg); color: var(--p-warn); }
.p-chip.danger { background: var(--p-danger-bg); color: var(--p-danger); }
.p-chip.pill { border-radius: 999px; }
.p-chip svg { width: 15px; height: 15px; }
.p-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; scroll-snap-type: x proximity; }
.p-tabs::-webkit-scrollbar { display: none; }
.p-tab { flex: 1 0 auto; min-height: 42px; padding: 0 16px; border: 1px solid var(--p-line); border-radius: 14px; background: var(--p-card); color: var(--p-text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; scroll-snap-align: start; transition: background .18s ease, color .18s ease, border-color .18s ease; }
:root[data-theme="dark"] .p-tab { background: transparent; border-color: var(--p-line-strong); }
:root .p-tabs .p-tab[aria-selected="true"] { background: var(--p-blue); border-color: var(--p-blue); color: #fff; }
.p-tab .p-count { margin-left: 6px; font-size: 12px; opacity: .7; }
.p-seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 22px; background: var(--p-raised); }
.p-seg button { position: relative; z-index: 1; min-height: 40px; padding: 0 10px; border: 0; border-radius: 18px; background: transparent; color: var(--p-text-2); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: color .2s ease, background .2s ease, box-shadow .2s ease; }
.p-seg button[aria-pressed="true"] { background: var(--p-lime); color: var(--p-lime-ink); box-shadow: 0 6px 14px -10px rgba(80, 110, 0, .7); }
.p-seg.blue button[aria-pressed="true"] { background: var(--p-blue); color: #fff; box-shadow: 0 8px 18px -10px var(--p-blue); }
.p-seg.sm button { min-height: 34px; font-size: 13px; }
.p-seg.soft { background: var(--p-card-2); border: 1px solid var(--p-line); }
.p-filter { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.p-filter::-webkit-scrollbar { display: none; }
.p-filter button { flex: none; min-height: 36px; padding: 0 14px; border: 1px solid var(--p-line); border-radius: 999px; background: var(--p-card); color: var(--p-text-2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
:root[data-theme="dark"] .p-filter button { background: transparent; border-color: var(--p-line-strong); color: var(--p-text); }
:root .p-filter button[aria-pressed="true"] { background: var(--p-lime); border-color: var(--p-lime); color: var(--p-lime-ink); }
:root .p-filter.blue button[aria-pressed="true"] { background: var(--p-blue); border-color: var(--p-blue); color: #fff; }
.p-filter button .p-count { margin-left: 4px; opacity: .6; }
.fc-chat-folders-glass {
  --folder-glass-solid: #f8f9fc;
  --folder-glass-fill: rgba(250, 251, 253, .76);
  --folder-selection: rgba(27, 34, 54, .10);
  display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none;
  padding: 3px; border: 1px solid var(--p-line); border-radius: 999px;
  background: var(--folder-glass-solid);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .45), 0 3px 9px rgba(20, 26, 45, .06);
}
:root[data-theme="dark"] .fc-chat-folders-glass {
  --folder-glass-solid: #232633;
  --folder-glass-fill: rgba(35, 38, 51, .76);
  --folder-selection: rgba(255, 255, 255, .14);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .fc-chat-folders-glass {
    background: var(--folder-glass-fill);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
  }
}
@media (prefers-reduced-transparency: reduce), (forced-colors: active) {
  .fc-chat-folders-glass {
    background: var(--folder-glass-solid);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
.fc-chat-folders-glass::-webkit-scrollbar { display: none; }
.fc-chat-folders-glass button {
  display: flex; flex: 1 0 auto; max-width: 16em; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 12px; border: 0; border-radius: 999px;
  background: transparent; color: var(--p-text); font: inherit; font-size: .875rem; font-weight: 650; cursor: pointer;
}
.fc-chat-folders-glass button[aria-pressed="true"] {
  background: var(--folder-selection);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .32);
}
.fc-chat-folders-glass button:focus-visible { outline: 2px solid var(--p-blue); outline-offset: -2px; }
@media (forced-colors: active) {
  .fc-chat-folders-glass button[aria-pressed="true"] { outline: 1px solid Highlight; outline-offset: -1px; }
}
.fc-chat-folders-glass .fc-chat-folder-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fc-chat-folder-count {
  display: grid; flex: none; place-items: center; min-width: 22px; min-height: 22px; padding: 0 5px;
  border-radius: 999px; background: #0069d9; color: #fff; font-size: .75rem; font-weight: 700;
}
.fc-chat-folder-count[data-muted="true"] { background: #666a78; }


/* ---- поиск и поля ---- */
.p-search { position: relative; display: flex; align-items: center; }
.p-search svg { position: absolute; left: 16px; width: 20px; height: 20px; color: var(--p-text-2); pointer-events: none; }
.p-search input { width: 100%; min-height: 50px; padding: 0 16px 0 48px; border: 1px solid var(--p-line); border-radius: 18px; background: var(--p-raised); color: var(--p-text); font: inherit; font-size: 15.5px; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
.p-search input::placeholder { color: var(--p-text-2); }
.p-search input:focus { border-color: var(--p-blue-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--p-blue) 18%, transparent); }
.p-field { display: grid; gap: 6px; }
.fc-meeting-timeline { display: grid; gap: 8px; padding-left: 19px; position: relative; }
.fc-meeting-timeline::before { content: ""; position: absolute; left: 4px; top: 23px; bottom: 23px; border-left: 1px solid var(--p-line); }
.fc-meeting-timeline details { position: relative; min-width: 0; border: 1px solid var(--p-line); border-radius: 14px; background: var(--p-card); }
.fc-meeting-timeline details::before { content: ""; position: absolute; left: -20px; top: 18px; width: 9px; height: 9px; border-radius: 50%; background: var(--p-text); }
.fc-meeting-timeline details[open] { background: var(--p-raised); }
.fc-meeting-timeline summary { display: flex; min-height: 46px; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 12px; border-radius: 13px; cursor: pointer; list-style: none; }
.fc-meeting-timeline summary::-webkit-details-marker { display: none; }
.fc-meeting-timeline summary > span { display: grid; gap: 2px; min-width: 0; }
.fc-meeting-timeline summary > span > span { color: var(--p-text-2); font-size: .875em; }
.fc-meeting-timeline summary svg { flex: none; width: 17px; height: 17px; color: var(--p-text-2); transform: rotate(90deg); }
.fc-meeting-timeline details[open] summary svg { transform: rotate(-90deg); }
.fc-meeting-timeline details > p { margin: 0; padding: 0 12px 10px; }
.p-field > label { font-size: 13px; font-weight: 600; color: var(--p-text-2); }
.p-input, .p-select, .p-textarea { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid var(--p-line-strong); border-radius: 14px; background: var(--p-card); color: var(--p-text); font: inherit; font-size: 16px; outline: none; }
/* WebKit's native date value must shrink with its form column. */
.p-input[type="date"] { appearance: none; -webkit-appearance: none; display: block; box-sizing: border-box; min-width: 0; max-width: 100%; }
:root[data-theme="dark"] .p-input, :root[data-theme="dark"] .p-select, :root[data-theme="dark"] .p-textarea { background: var(--p-raised); }
.p-textarea { min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.p-input:focus, .p-select:focus, .p-textarea:focus { border-color: var(--p-blue-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--p-blue) 16%, transparent); }
.p-input[aria-invalid="true"] { border-color: var(--p-danger); }
.p-form { display: grid; gap: 14px; }
.p-form .p-grid-2 { gap: 10px; }
.p-hint { font-size: 12.5px; color: var(--p-text-2); }
.p-err { font-size: 13px; color: var(--p-danger); font-weight: 600; }

/* ---- KPI ---- */
.p-kpi { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px; border: 1px solid var(--p-line); border-radius: 20px; background: var(--p-card); }
:root[data-theme="dark"] .p-kpi { background: var(--p-card); }
.p-kpi .ico { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--p-blue-soft); color: var(--p-blue-text); }
.p-kpi .ico svg { width: 22px; height: 22px; }
.p-kpi .ico.lime { background: var(--p-lime); color: var(--p-lime-ink); }
.p-kpi .ico.lav { background: var(--p-lav-soft); color: var(--p-lav-text); }
.p-kpi .ico.peach { background: #FFEBD8; color: #B4621B; }
:root[data-theme="dark"] .p-kpi .ico.peach { background: rgba(255, 180, 110, .18); color: #FFC48B; }
.p-kpi .ico.plain { background: transparent; color: var(--p-text); width: 30px; }
.p-kpi b { display: block; font-size: 21px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.p-kpi span { display: block; font-size: 12.5px; color: var(--p-text-2); line-height: 1.25; }
.p-kpi.stack { flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; }
.p-kpi.stack b { font-size: 30px; }

/* ---- списки ---- */
.p-list { display: grid; gap: 8px; }
.p-item { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; border: 1px solid var(--p-line); border-radius: 20px; background: var(--p-card); color: inherit; text-decoration: none !important; text-align: left; font: inherit; width: 100%; }
button.p-item, a.p-item { cursor: pointer; transition: background .15s ease, transform .15s ease; }
button.p-item:hover, a.p-item:hover { background: var(--p-card-2); }
button.p-item:active, a.p-item:active { transform: scale(.99); }
.p-item .title { font-size: 15.5px; font-weight: 650; line-height: 1.25; }
.p-item .meta { font-size: 13px; color: var(--p-text-2); line-height: 1.3; margin-top: 2px; }
.p-item .end { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--p-text-2); flex: none; }
.p-item .end svg { width: 20px; height: 20px; }
.p-item .time { width: 52px; flex: none; font-size: 15.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.p-item.dim { opacity: .62; }
.p-rows { display: grid; }
.p-rows > * + * { border-top: 1px solid var(--p-line); }
.p-rows > .p-item { border: 0; border-radius: 0; background: transparent; min-height: 60px; padding-inline: 4px; }

/* ---- пустые/ошибки/скелет ---- */
.p-empty { display: grid; justify-items: center; gap: 10px; padding: 28px 18px; text-align: center; color: var(--p-text-2); }
.p-empty .ico { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--p-raised); color: var(--p-blue-text); }
.p-empty .ico svg { width: 28px; height: 28px; }
.p-empty h3 { color: var(--p-text); font-size: 17px; margin: 0; }
.p-empty p { max-width: 38ch; font-size: 14px; }
.p-skel { border-radius: 20px; background: linear-gradient(100deg, var(--p-raised) 30%, var(--p-card-2) 50%, var(--p-raised) 70%); background-size: 300% 100%; animation: p-shimmer 1.3s ease-in-out infinite; }
@keyframes p-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes p-spin { to { transform: rotate(360deg); } }
.p-offline { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; background: var(--p-warn-bg); color: var(--p-warn); font-size: 13.5px; font-weight: 600; }
.p-player .p-offline-note { display:grid;gap:10px;min-width:0; }
.p-player .p-offline-note > p { margin:0; }
.p-player .p-offline-note > .p-row { flex-wrap:wrap;gap:8px;min-width:0; }
.p-player .p-offline-note > .p-row > .p-btn { flex:1 1 200px;min-width:0;white-space:normal;overflow-wrap:anywhere; }
.p-stale { font-size: 12px; color: var(--p-text-3); }

/* ===================== главная ===================== */
.p-hello { display: grid; gap: 4px; margin-top: 2px; }
.p-prio { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 88px; padding: 16px 18px; border: 0; border-radius: 24px; color: var(--p-prio-1-ink); text-align: left; font: inherit; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.p-prio:active { transform: scale(.985); }
.p-prio.lime { background: var(--p-prio-1); }
.p-prio.lav { background: var(--p-prio-2); color: #12173A; }
:root[data-theme="light"] .p-prio.lime { border: 1px solid #DDF39B; }
:root[data-theme="light"] .p-prio.lav { border: 1px solid #DCE0FA; }
.p-prio .name { font-size: 17px; font-weight: 700; }
.p-prio .what { font-size: 14.5px; opacity: .78; margin-top: 2px; }
.p-prio .when { display: flex; align-items: center; gap: 6px; font-size: 12.5px; opacity: .72; margin-top: 4px; }
.p-prio .when svg { width: 15px; height: 15px; }
.p-prio > svg { width: 24px; height: 24px; flex: none; margin-left: auto; }
.p-stat3 .p-kpi.stack { min-height: 92px; justify-content: space-between; }
:root[data-theme="dark"] .p-stat3 .p-kpi.stack { background: transparent; border-color: var(--p-line-strong); }
.p-hero-tr { display: grid; grid-template-columns: 42% minmax(0, 1fr); gap: 16px; align-items: stretch; padding: 8px; border-radius: 26px; background: linear-gradient(135deg, var(--p-tr-hero-a), var(--p-tr-hero-b)); border: 1px solid color-mix(in srgb, var(--p-blue) 18%, transparent); color: var(--p-text); overflow: hidden; }
:root[data-theme="dark"] .p-hero-tr { border-color: rgba(120, 140, 255, .25); }
.p-hero-tr .body { display: grid; align-content: center; gap: 4px; padding: 8px 8px 8px 0; }
.p-hero-tr .p-eyebrow { color: var(--p-text-2); }
.p-hero-tr h3 { font-size: 22px; font-weight: 750; margin: 0; letter-spacing: -.02em; }
.p-hero-tr .p-btn { margin-top: 10px; }
.p-media { position: relative; overflow: hidden; border-radius: 20px; min-height: 132px; background: linear-gradient(145deg, #6F82FF, #3F4FE0); display: grid; place-items: center; color: rgba(255, 255, 255, .9); }
.p-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.p-media .ph { display: grid; justify-items: center; gap: 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; opacity: .9; text-align: center; padding: 8px; }
.p-media .ph svg { width: 40px; height: 40px; stroke-width: 1.6; }
.p-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.p-day { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 64px; padding: 6px 0 10px; border: 1px solid var(--p-line); border-radius: 18px; background: var(--p-card); color: var(--p-text); font: inherit; cursor: pointer; transition: background .18s ease, transform .15s ease, border-color .18s ease; }
:root[data-theme="dark"] .p-day { background: transparent; border-color: var(--p-line-strong); }
.p-day small { font-size: 12px; color: var(--p-text-2); font-weight: 500; }
.p-day b { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.p-day i { position: absolute; bottom: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--p-text-3); }
.p-day i.done { background: var(--p-lime-2); }
:root .p-week .p-day[aria-pressed="true"] { background: var(--p-lime); border-color: var(--p-lime); color: var(--p-lime-ink); }
.p-day[aria-pressed="true"] small { color: var(--p-lime-ink); }
.p-day[aria-pressed="true"] i { background: var(--p-lime-ink); }
.p-day.is-today:not([aria-pressed="true"]) b { color: var(--p-blue-text); }
.p-day:active { transform: scale(.95); }
.p-paused { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 18px; border: 1px solid var(--p-line); border-radius: 22px; background: var(--p-card); }
.p-paused b { font-size: 16px; font-weight: 700; }
.p-hero-at { position: relative; display: grid; gap: 6px; padding: 18px; min-height: 230px; border-radius: 28px; overflow: hidden; background: linear-gradient(140deg, var(--p-hero-a), var(--p-hero-b)); color: var(--p-hero-ink); isolation: isolate; }
:root[data-theme="light"] .p-hero-at { border: 1px solid #D6DDFF; }
.p-hero-at .p-eyebrow { display: flex; align-items: center; gap: 8px; color: var(--p-hero-ink); opacity: .85; }
.p-hero-at .p-eyebrow .ib { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .55); color: var(--p-blue); }
:root[data-theme="dark"] .p-hero-at .p-eyebrow .ib { background: rgba(255, 255, 255, .18); color: #fff; }
.p-hero-at .p-eyebrow .ib svg { width: 18px; height: 18px; }
.p-hero-at h2 { max-width: 64%; font-size: 30px; line-height: 1.04; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 2px; }
.p-hero-at .sub { font-size: 14px; color: var(--p-hero-sub); }
.p-hero-at .p-btn { margin-top: 10px; z-index: 2; }
.p-hero-at .art { position: absolute; right: -10px; top: 36px; bottom: 60px; width: 52%; z-index: -1; display: grid; place-items: center; color: color-mix(in srgb, var(--p-hero-ink) 22%, transparent); }
.p-hero-at .art img { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; }
.p-hero-at .art svg { width: 120px; height: 120px; stroke-width: 1.2; }
.p-kpi-big { position: relative; display: flex; align-items: center; gap: 10px; min-height: 92px; padding: 14px 16px; border-radius: 24px; border: 0; text-align: left; font: inherit; color: #12173A; cursor: pointer; }
.p-kpi-big.lime { background: var(--p-kpi-lime); }
.p-kpi-big.lav { background: var(--p-kpi-lav); }
:root[data-theme="light"] .p-kpi-big.lime { border: 1px solid #DFF4A2; }
:root[data-theme="light"] .p-kpi-big.lav { border: 1px solid #DFE3FB; }
.p-kpi-big b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.p-kpi-big span { display: block; font-size: 13px; line-height: 1.25; opacity: .78; margin-top: 4px; }
.p-kpi-big > svg { width: 24px; height: 24px; flex: none; }
.p-kpi-big > svg:last-child:not(:first-child) { position: absolute; top: 14px; right: 14px; width: 20px; height: 20px; opacity: .8; }
.p-kpi-big .p-grow { padding-right: 18px; }
.p-kpi-big.lime b { font-size: 24px; }
.p-kpi-big .p-ring-mini { flex: none; }
.p-water { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border: 1px solid var(--p-line); border-radius: 22px; background: var(--p-card); }
.p-water .drop { color: var(--p-text); width: 28px; height: 28px; flex: none; }
.p-water b { font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; }
.p-water .p-btn { margin-left: auto; border-radius: 999px; }
.p-water .bar { height: 6px; border-radius: 6px; background: var(--p-raised); overflow: hidden; margin-top: 6px; }
.p-water .bar i { display: block; height: 100%; border-radius: inherit; background: var(--p-water); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.p-coach { display: grid; gap: 10px; }
.p-coach blockquote { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--p-text); }
.p-next { display: grid; gap: 6px; }
.p-next > .p-row:first-child svg { width: 22px; height: 22px; flex: none; }
.p-next .p-link { white-space: nowrap; font-size: 13.5px; }
.p-next .time { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ===================== кольца, полосы, графики ===================== */
.p-ring { position: relative; display: grid; place-items: center; flex: none; }
.p-ring svg { transform: rotate(-90deg); overflow: visible; }
.p-ring .trk { stroke: var(--p-raised); }
.p-ring .val { stroke: var(--p-lime-2); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2, .8, .2, 1); }
:root[data-theme="light"] .p-ring .val { stroke: #CDF35A; }
.p-ring .val.over { stroke: var(--p-warn); }
.p-ring .ctr { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.p-ring .ctr b { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.p-ring .ctr span { font-size: 13px; color: var(--p-text-2); margin-top: 4px; }
.p-ring-mini .trk { stroke: rgba(18, 23, 58, .14); }
.p-ring-mini .val { stroke: #12173A; }
.p-macro { display: grid; gap: 6px; }
.p-macro .top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.p-macro .top b { font-size: 15px; }
.p-macro .top small { color: var(--p-text-2); font-size: 12.5px; }
.p-macro .track { position: relative; display: flex; align-items: center; gap: 10px; }
.p-macro .bar { flex: 1 1 auto; height: 8px; border-radius: 8px; background: var(--p-raised); overflow: hidden; }
.p-macro .bar i { display: block; height: 100%; border-radius: inherit; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.p-macro .pct { width: 38px; text-align: right; font-size: 12.5px; color: var(--p-text-2); font-variant-numeric: tabular-nums; }
.p-macro.protein .bar i { background: var(--p-protein); }
.p-macro.fat .bar i { background: var(--p-fat); }
.p-macro.carbs .bar i { background: var(--p-carbs); }
.p-macro.over .pct { color: var(--p-warn); font-weight: 700; }
.p-chart { width: 100%; height: auto; display: block; overflow: visible; }
.p-chart .grid { stroke: var(--p-line); stroke-width: 1; }
.p-chart .ax { fill: var(--p-text-2); font-size: 11px; font-family: var(--font); }
.p-chart .lbl { fill: var(--p-text); font-size: 11.5px; font-weight: 600; font-family: var(--font); }
.p-chart .ln { fill: none; stroke: var(--p-lime-2); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
:root[data-theme="light"] .p-chart .ln { stroke: #C5EC42; }
.p-chart .ar { fill: url(#p-area); }
.p-chart .pt { fill: var(--p-lime-2); stroke: var(--p-card); stroke-width: 2.5; }
:root[data-theme="light"] .p-chart .pt { fill: #C5EC42; }
.p-heat { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.p-heat i { aspect-ratio: 1.35; border-radius: 7px; background: var(--p-raised); transition: transform .2s ease; }
:root[data-theme="light"] .p-heat i { background: #DFE3F5; }
.p-heat i.on { background: var(--p-lime-2); }
:root[data-theme="light"] .p-heat i.on { background: #CDF35A; }
.p-heat i.today { outline: 2px solid var(--p-blue-2); outline-offset: 1px; }
.p-legend { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--p-text-2); }
.p-legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--p-lime-2); }
.p-bars { display: flex; align-items: flex-end; gap: 8px; height: 46px; }
.p-bars i { flex: 1 1 0; min-height: 4px; border-radius: 6px; background: var(--p-lime-2); transition: height .8s cubic-bezier(.2, .8, .2, 1); }
.p-bars i.none { background: var(--p-raised); height: 4px !important; }
.p-bars-l { display: flex; gap: 8px; font-size: 11.5px; color: var(--p-text-2); }
.p-bars-l span { flex: 1 1 0; text-align: center; }
.p-vpill { display: grid; justify-items: center; gap: 6px; }
.p-vpill i { width: 16px; height: 34px; border-radius: 10px; }
.p-vpill b { font-size: 15px; }
.p-vpill small { font-size: 11.5px; color: var(--p-text-2); }

/* ===================== программы и конструктор ===================== */
.p-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.p-tpl-hero { position: relative; overflow: hidden; padding: 16px; border-radius: 26px; background: linear-gradient(120deg, var(--p-card) 0%, var(--p-blue-soft) 100%); border: 1px solid color-mix(in srgb, var(--p-blue) 25%, transparent); }
:root[data-theme="dark"] .p-tpl-hero { background: linear-gradient(120deg, #222B49 0%, #2B3A86 100%); border-color: rgba(120, 140, 255, .35); }
.p-tpl-hero .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.p-tpl-hero h3 { font-size: 22px; font-weight: 750; letter-spacing: -.02em; margin: 8px 0 4px; max-width: 70%; }
.p-tpl-hero .art { position: absolute; right: 12px; top: 12px; width: 36%; height: 104px; border-radius: 18px; overflow: hidden; opacity: .95; }
.p-tpl-hero .p-actions { margin-top: 14px; grid-template-columns: auto auto minmax(0, 1fr); grid-auto-flow: row; }
.p-prog-card .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; color: var(--p-text-2); font-size: 13px; }
.p-prog-card .meta span { display: inline-flex; align-items: center; gap: 6px; }
.p-prog-card .meta svg { width: 16px; height: 16px; }
.p-prog-card h3 { font-size: 20px; font-weight: 750; margin: 10px 0 2px; letter-spacing: -.02em; }
.p-prog-card .p-actions { margin-top: 14px; }
.p-qa { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.p-qa button { display: flex; align-items: flex-start; gap: 10px; min-height: 76px; padding: 12px; border: 1px solid var(--p-line); border-radius: 20px; background: var(--p-card); color: var(--p-text); font: inherit; text-align: left; cursor: pointer; transition: transform .15s ease, background .15s ease; }
.p-qa button:hover { background: var(--p-card-2); }
.p-qa button:active { transform: scale(.97); }
.p-qa .ico { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--p-blue); color: #fff; }
.p-qa .ico.soft { background: var(--p-blue-soft); color: var(--p-blue-text); }
.p-qa .ico svg { width: 22px; height: 22px; }
.p-qa b { display: block; font-size: 13.5px; font-weight: 650; line-height: 1.2; }
.p-qa small { display: block; font-size: 11.5px; color: var(--p-text-2); line-height: 1.2; margin-top: 3px; }
.p-ctx { display: flex; align-items: center; gap: 12px; }
.p-ctx .who b { display: block; font-size: 19px; font-weight: 700; }
.p-ctx .who small { display: block; font-size: 12.5px; color: var(--p-text-2); margin-top: 2px; }
.p-wo { display: grid; gap: 10px; }
.p-wo-head { display: flex; align-items: center; gap: 10px; }
.p-wo-head h3 { font-size: 20px; font-weight: 750; margin: 0; letter-spacing: -.02em; }
.p-wo-head .p-cap { margin-top: 2px; }
.p-ex { display: grid; grid-template-columns: 26px 72px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 92px; padding: 10px 6px 10px 4px; border: 1px solid var(--p-line); border-radius: 20px; background: var(--p-card-2); transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease; touch-action: pan-y; }
.p-ex.dragging { opacity: .9; transform: scale(1.02); box-shadow: var(--p-shadow-lg); z-index: 5; position: relative; }
.p-ex.drop-before { box-shadow: 0 -3px 0 var(--p-blue); }
.p-ex .grip { display: grid; place-items: center; width: 26px; height: 44px; color: var(--p-text-3); cursor: grab; touch-action: none; border: 0; background: none; padding: 0; }
.p-ex .grip svg { width: 18px; height: 18px; }
.p-ex .thumb { width: 72px; height: 72px; border-radius: 14px; overflow: hidden; }
.p-ex .name { font-size: 15px; font-weight: 650; line-height: 1.25; }
.p-ex .note { font-size: 12.5px; color: var(--p-text-2); line-height: 1.3; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-ex .dose { display: grid; gap: 6px; justify-items: stretch; }
.p-ex .dose span { min-width: 64px; padding: 5px 8px; border: 1px solid var(--p-line-strong); border-radius: 10px; background: var(--p-card); font-size: 14px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .p-ex .dose span { background: transparent; }
.p-ex .dose span.rpe { font-size: 12.5px; color: var(--p-text-2); }
.p-ex .tools { display: flex; align-items: center; }
.p-ex .tools button { width: 34px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: var(--p-text); border-radius: 10px; cursor: pointer; padding: 0; }
.p-ex .tools button:hover { background: var(--p-raised); }
.p-ex .tools svg { width: 19px; height: 19px; }
.p-ex .order { display: none; }
.p-lib { display: grid; gap: 12px; }
.p-lib-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 46%); gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 2px; }
.p-lib-strip::-webkit-scrollbar { display: none; }
.p-lib-card { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--p-line); border-radius: 18px; background: var(--p-card-2); scroll-snap-align: start; }
.p-lib-card .thumb { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; }
.p-lib-card b { display: block; font-size: 14px; font-weight: 650; line-height: 1.2; }
.p-lib-card .p-chip { margin-top: 6px; }
.p-addbtn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 0; background: var(--p-blue-soft); color: var(--p-blue-text); cursor: pointer; transition: transform .15s ease, background .15s ease; }
:root[data-theme="dark"] .p-addbtn { background: #5160E8; color: #fff; }
.p-addbtn:hover { transform: scale(1.06); }
.p-addbtn svg { width: 20px; height: 20px; }
.p-addbtn.done { background: var(--p-lime); color: var(--p-lime-ink); }
.p-sticky { position: sticky; bottom: calc(var(--tabbar-h, 0px) + 18px + var(--safe-b)); z-index: 30; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 10px; padding: 10px; border: 1px solid var(--p-line); border-radius: 26px; background: color-mix(in srgb, var(--p-card) 92%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--p-shadow-lg); }
body.p-fullscreen .p-sticky { bottom: calc(10px + var(--safe-b)); }
.p-thumb-ph { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255, 255, 255, .92); background: linear-gradient(145deg, var(--ph-a, #7385FF), var(--ph-b, #4656E8)); }
.p-thumb-ph svg { width: 44%; height: 44%; stroke-width: 1.7; }
.p-thumb-ph[data-g="chest"] { --ph-a: #7385FF; --ph-b: #4656E8; }
.p-thumb-ph[data-g="back"] { --ph-a: #6E9BFF; --ph-b: #3E66E0; }
.p-thumb-ph[data-g="legs"] { --ph-a: #8A7BFF; --ph-b: #5B4BE0; }
.p-thumb-ph[data-g="glutes"] { --ph-a: #B07BFF; --ph-b: #7C4BE0; }
.p-thumb-ph[data-g="core"] { --ph-a: #5FB8E8; --ph-b: #3A86C9; }
.p-thumb-ph[data-g="shoulders"] { --ph-a: #7B8DFF; --ph-b: #5466F0; }
.p-thumb-ph[data-g="arms"] { --ph-a: #6C7CF7; --ph-b: #3E4FD6; }
.p-thumb-ph[data-g="cardio"] { --ph-a: #F59C7B; --ph-b: #E0684B; }
.p-thumb-ph[data-g="full_body"] { --ph-a: #64C7A8; --ph-b: #2E9C7C; }
.p-thumb { position: relative; overflow: hidden; background: var(--p-raised); }
.p-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===================== календарь ===================== */
.p-month { padding: 16px 14px 14px; border-radius: 28px; background: var(--p-month-card); color: var(--p-month-ink); border: 1px solid var(--p-line); box-shadow: var(--p-shadow); }
:root[data-theme="dark"] .p-month { border-color: rgba(140, 155, 255, .5); box-shadow: 0 18px 40px -16px rgba(60, 80, 240, .6); }
.p-month-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.p-month-head b { font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.p-month-head .p-iconbtn { background: var(--p-raised); width: 42px; height: 42px; }
:root[data-theme="dark"] .p-month-head .p-iconbtn { background: rgba(255, 255, 255, .16); color: #fff; }
.p-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 4px; text-align: center; }
.p-cal .wd { font-size: 13px; color: var(--p-month-muted); font-weight: 500; padding-bottom: 6px; }
:root[data-theme="light"] .p-cal .wd { color: var(--p-text-2); }
.p-cal button { position: relative; justify-self: center; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: inherit; font: inherit; font-size: 15.5px; font-weight: 500; cursor: pointer; font-variant-numeric: tabular-nums; transition: background .15s ease, transform .15s ease; }
.p-cal button.out { color: var(--p-month-muted); }
.p-cal button.has { background: var(--p-blue-soft); color: var(--p-blue-text); font-weight: 600; }
:root[data-theme="dark"] .p-cal button.has { background: rgba(255, 255, 255, .16); color: #fff; }
.p-cal button[aria-pressed="true"] { background: var(--p-lime); color: var(--p-lime-ink); font-weight: 750; box-shadow: 0 8px 18px -10px rgba(120, 150, 0, .8); }
.p-cal button i { position: absolute; bottom: 5px; display: flex; gap: 3px; }
.p-cal button i u { width: 5px; height: 5px; border-radius: 50%; background: var(--p-blue); text-decoration: none; }
.p-cal button i u.g { background: var(--p-lime-2); }
:root[data-theme="dark"] .p-cal button i u { background: #DCFB7C; }
.p-cal button[aria-pressed="true"] i u { background: var(--p-lime-ink); }
.p-cal button:active { transform: scale(.92); }
.p-cal button.is-today:not([aria-pressed="true"]) { box-shadow: inset 0 0 0 1.5px var(--p-blue-2); }
.p-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.p-slot { min-height: 48px; border: 0; border-radius: 16px; background: var(--p-raised); color: var(--p-text); font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; box-shadow: inset 0 -2px 0 rgba(30, 40, 120, .06); transition: background .15s ease, transform .15s ease; }
:root[data-theme="light"] .p-slot { background: linear-gradient(180deg, #F2F3FD, #E3E6FA); }
:root[data-theme="dark"] .p-slot { background: linear-gradient(180deg, #E6E5FF, #C9C9F7); color: #12173A; }
.p-slot[aria-pressed="true"] { background: var(--p-lime) !important; color: var(--p-lime-ink); }
.p-slot:active { transform: scale(.96); }
.p-cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.p-cat { display: grid; justify-items: center; gap: 6px; min-height: 76px; padding: 12px 4px; border: 1px solid var(--p-line); border-radius: 20px; background: var(--p-card); color: var(--p-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: transform .15s ease, background .15s ease; }
:root[data-theme="dark"] .p-cat { background: var(--p-card); }
.p-cat svg { width: 26px; height: 26px; color: var(--p-text); }
:root[data-theme="light"] .p-cat svg { color: #232A6B; }
.p-cat:active { transform: scale(.95); }
.p-cat[aria-pressed="true"] { border-color: var(--p-blue); box-shadow: 0 0 0 2px var(--p-blue) inset; }
.p-dstrip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.p-dstrip button { display: grid; justify-items: center; gap: 2px; min-height: 64px; padding: 6px 0; border: 0; border-radius: 18px; background: var(--p-raised); color: var(--p-text); font: inherit; cursor: pointer; position: relative; }
:root[data-theme="light"] .p-dstrip button { background: #F1F3FC; }
.p-dstrip small { font-size: 12.5px; color: var(--p-text-2); }
.p-dstrip b { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
:root .p-dstrip button[aria-pressed="true"] { background: var(--p-lime); color: var(--p-lime-ink); }
.p-dstrip button[aria-pressed="true"] small { color: var(--p-lime-ink); }
.p-dstrip button i { position: absolute; bottom: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--p-blue); }
.p-dstrip button[aria-pressed="true"] i { background: var(--p-lime-ink); }
.p-tl { position: relative; display: grid; gap: 10px; }
.p-tl-row { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; align-items: start; position: relative; }
.p-tl-row .t { position: relative; padding: 14px 0 0 22px; white-space: nowrap; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.25; }
.p-tl-row .t small { display: block; margin-top: 4px; font-size: 13.5px; font-weight: 500; color: var(--p-text-2); }
.p-tl-row .t::before { content: ""; position: absolute; left: 3px; top: 18px; width: 11px; height: 11px; border-radius: 50%; border: 2.5px solid var(--p-blue-2); background: var(--p-card); box-sizing: border-box; z-index: 1; }
.p-tl-row.personal .t::before { border-color: #F08AC9; }
.p-tl-row.now .t::before { background: var(--p-blue-2); }
.p-tl::before { content: ""; position: absolute; left: 7.5px; top: 22px; bottom: 22px; width: 2px; background: color-mix(in srgb, var(--p-blue-2) 55%, transparent); border-radius: 2px; }
.p-ev { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 76px; padding: 12px 8px 12px 14px; border: 1px solid var(--p-line); border-radius: 20px; background: var(--p-card); color: var(--p-text); text-align: left; font: inherit; width: 100%; cursor: pointer; box-shadow: var(--p-shadow); transition: transform .15s ease; }
:root[data-theme="dark"] .p-ev { background: #FFFFFF; color: #12173A; border-color: transparent; }
:root[data-theme="dark"] .p-ev .p-cap { color: #69728F; }
.p-ev:active { transform: scale(.985); }
.p-ev b { display: block; font-size: 15.5px; font-weight: 650; }
.p-ev .p-cap { display: flex; align-items: center; gap: 4px; }
.p-ev .p-cap svg { width: 14px; height: 14px; }
.p-ev .ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; }
.p-ev .ico svg { width: 24px; height: 24px; }
.p-ev.lunch { background: var(--p-lunch); color: var(--p-lunch-ink); border-color: transparent; box-shadow: none; }
.p-ev.lunch .ico { background: var(--p-lunch-ico); }
.p-ev.drive { background: var(--p-drive); color: var(--p-drive-ink); border-color: transparent; box-shadow: none; }
.p-ev.drive .ico { background: var(--p-drive-ico); }
.p-ev.break { background: var(--p-break); color: var(--p-break-ink); border-color: transparent; box-shadow: none; }
.p-ev.break .ico { background: var(--p-break-ico); }
.p-ev.personal, .p-ev.other { background: var(--p-personal); color: var(--p-personal-ink); border-color: transparent; box-shadow: none; }
.p-ev.personal .ico, .p-ev.other .ico { background: var(--p-personal-ico); }
.p-ev.lunch .p-cap, .p-ev.drive .p-cap, .p-ev.break .p-cap, .p-ev.personal .p-cap, .p-ev.other .p-cap { color: inherit; opacity: .72; }
.p-ev.group .ico { background: var(--p-blue-soft); color: var(--p-blue-text); }
.p-ev.external { border-style: dashed; }
.p-ev .more { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: inherit; opacity: .7; }

/* ===================== чат ===================== */
.p-chat-layout { display: grid; gap: 12px; }
.p-contacts { display: grid; grid-auto-flow: column; grid-auto-columns: 78px; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 4px; }
.p-contacts::-webkit-scrollbar { display: none; }
.p-contact { display: grid; justify-items: center; gap: 6px; border: 0; background: none; color: var(--p-text); font: inherit; font-size: 12.5px; line-height: 1.2; text-align: center; cursor: pointer; padding: 0; }
.p-contact .p-ava-ring .p-ava { width: 64px; height: 64px; }
.p-contact .new { width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; background: var(--p-lime); color: var(--p-lime-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--p-lime) 40%, transparent); }
.p-contact .new svg { width: 30px; height: 30px; }
.p-conv { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 10px; border: 0; border-radius: 20px; background: transparent; color: var(--p-text); text-align: left; font: inherit; cursor: pointer; width: 100%; transition: background .15s ease; position: relative; }
.p-conv + .p-conv::before { content: ""; position: absolute; left: 92px; right: 10px; top: 0; height: 1px; background: var(--p-line); }
.p-conv:hover, .p-conv[aria-current="true"] { background: var(--p-card); }
.p-conv.pinned { background: var(--p-card); box-shadow: var(--p-shadow); }
:root[data-theme="dark"] .p-conv.pinned { background: var(--p-raised); box-shadow: none; }
.p-conv.pinned + .p-conv::before { display: none; }
.p-conv .p-ava { width: 64px; height: 64px; font-size: 19px; }
.p-conv .top { display: flex; align-items: center; gap: 6px; }
.p-conv .top b { font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-conv .top svg { width: 17px; height: 17px; color: var(--p-blue-text); flex: none; }
.p-conv .prev { font-size: 14.5px; color: var(--p-text-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; }
.p-conv .prev b { color: var(--p-text); font-weight: 600; }
.p-conv .side { align-self: start; display: grid; justify-items: end; gap: 8px; padding-top: 4px; }
.p-conv .side time { font-size: 13px; color: var(--p-text-2); }
.p-conv .side .ticks { color: var(--p-blue-2); width: 20px; height: 20px; }
.p-conv .unread { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; background: var(--p-lav); color: #1B1650; font-size: 13px; font-weight: 750; }
.p-conv .muted-ico { width: 18px; height: 18px; color: var(--p-text-3); }
.p-conv .voice { display: inline-flex; align-items: center; gap: 8px; }
.p-conv .voice i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--p-lav-soft); color: var(--p-lav-text); }
.p-fab { position: fixed; z-index: 40; right: 18px; bottom: calc(var(--tabbar-h) + 26px + var(--safe-b)); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; border: 0; background: var(--p-lime); color: var(--p-lime-ink); box-shadow: 0 14px 30px -12px rgba(120, 150, 0, .8); cursor: pointer; transition: transform .16s ease; }
.p-fab:active { transform: scale(.93); }
.p-fab svg { width: 26px; height: 26px; }
@media (min-width: 861px) { .p-fab { right: max(24px, calc(50vw - 600px)); bottom: 28px; } }
.p-thread { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: calc(var(--vvh, 100dvh) - var(--tabbar-h) - 36px - var(--safe-b)); min-height: 420px; }
.p-thread-head { display: flex; align-items: center; gap: 10px; padding: 4px 0 10px; border-bottom: 1px solid var(--p-line); }
.p-thread-head .who b { display: block; font-size: 19px; font-weight: 700; }
.p-thread-head .who small { display: block; font-size: 13.5px; color: var(--p-text-2); }
.p-thread-head .who small.on { color: #6BB52B; font-weight: 600; }
.p-thread-head .who small.typing { color: var(--p-blue-text, var(--p-text)); font-weight: 600; }
:root[data-theme="dark"] .p-thread-head .who small.on { color: #B6E78F; }
.p-msgs { overflow-y: auto; overscroll-behavior: contain; padding: 12px 2px; display: flex; flex-direction: column; gap: 6px; scroll-behavior: auto; -webkit-overflow-scrolling: touch; }
.p-msgs[data-bg="dots"] { background-image: radial-gradient(color-mix(in srgb, var(--p-blue) var(--ti, 14%), transparent) 1px, transparent 1.5px); background-size: 18px 18px; }
.p-msgs[data-bg="waves"] { background: repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--p-lav) var(--ti, 14%), transparent) 14px 16px); }
.p-msgs[data-bg="mint"] { background: color-mix(in srgb, #9EE6C6 var(--ti, 18%), transparent); border-radius: 18px; }
.p-msgs[data-bg="night"] { background: color-mix(in srgb, #1D2250 var(--ti, 30%), transparent); border-radius: 18px; }
.p-msgs[data-bg="sand"] { background: color-mix(in srgb, #F3D9A4 var(--ti, 20%), transparent); border-radius: 18px; }
.p-divider { align-self: center; padding: 4px 12px; margin: 6px 0; border-radius: 999px; font-size: 12.5px; color: var(--p-text-2); background: var(--p-raised); }
.p-msg { position: relative; max-width: min(84%, 520px); padding: 10px 14px 8px; border-radius: 20px; background: var(--p-in); color: var(--p-text); font-size: 15.5px; line-height: 1.42; box-shadow: var(--p-shadow); align-self: flex-start; overflow-wrap: anywhere; animation: none; touch-action: pan-y; transition: transform .18s ease; }
:root[data-theme="dark"] .p-msg { box-shadow: none; }
.p-msg.mine { align-self: flex-end; background: var(--p-out); color: var(--p-out-ink); border-bottom-right-radius: 8px; }
.p-msg:not(.mine) { border-bottom-left-radius: 8px; }
.p-msg[data-bubble="blue"].mine { background: var(--p-blue); color: #fff; }
.p-msg[data-bubble="lime"].mine { background: var(--p-lime); color: var(--p-lime-ink); }
.p-msg[data-bubble="graphite"].mine { background: #2D3446; color: #fff; }
.p-msg .meta { float: right; display: inline-flex; align-items: center; gap: 4px; margin: 6px 0 -2px 12px; font-size: 11.5px; opacity: .62; font-variant-numeric: tabular-nums; }
.p-msg .meta svg { width: 16px; height: 16px; }
.p-msg .meta .read { color: var(--p-blue); opacity: 1; }
.fc-chat-document-size { display: none; }
.p-msg.mine[data-bubble="blue"] .meta .read { color: #fff; }
.p-msg .fwd { font-size: 12.5px; opacity: .7; margin-bottom: 2px; }
.p-msg .reply { padding: 6px 10px; margin: 0 -4px 6px; border-left: 3px solid var(--p-blue-2); border-radius: 8px; background: color-mix(in srgb, var(--p-blue) 8%, transparent); font-size: 13px; }
.p-msg .reply b { display: block; font-size: 12.5px; }
.p-msg.deleted { font-style: italic; opacity: .6; }
.p-msg.pending { opacity: .65; }
.p-msg.failed { box-shadow: 0 0 0 1.5px var(--p-danger); }
.p-msg .failed-note { display: block; font-size: 12px; color: var(--p-danger); margin-top: 4px; }
.p-msg.swiping { transition: none; }
.p-reacts { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 4px; align-self: flex-start; }
.p-reacts.mine { align-self: flex-end; }
.p-reacts button { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 10px; border: 1px solid var(--p-line); border-radius: 999px; background: var(--p-card); font: inherit; font-size: 14px; cursor: pointer; }
.p-reacts button.mine { border-color: var(--p-blue-2); background: var(--p-blue-soft); }
.p-reacts .addr { width: 32px; padding: 0; justify-content: center; color: var(--p-text-2); }
.p-refcard { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; align-items: stretch; gap: 14px; max-width: min(96%, 560px); padding: 8px; border-radius: 20px; background: var(--p-in); border: 1px solid var(--p-line); color: var(--p-text); text-align: left; font: inherit; cursor: pointer; align-self: flex-start; box-shadow: var(--p-shadow); animation: none; }
:root[data-theme="dark"] .p-refcard { box-shadow: none; }
.p-refcard.mine { align-self: flex-end; }
.p-chat-booking-bar{padding:4px 12px 8px;background:var(--p-card)}
.p-chat-booking-event{width:min(95%,440px);align-self:flex-start}
.p-chat-booking-event.mine{align-self:flex-end}
.p-thread :is(.p-chat-booking-bar,.p-chat-booking-event) .fc-athlete-booking-row{padding:10px 12px;min-height:64px;border:1px solid var(--p-line);border-radius:16px;background:var(--p-card-2)}
.p-thread :is(.p-chat-booking-bar,.p-chat-booking-event) .fc-athlete-booking-icon{flex-basis:42px;height:42px;border-radius:12px;background:var(--p-lime);color:var(--p-lime-ink)}
.p-thread :is(.p-chat-booking-bar,.p-chat-booking-event) .fc-athlete-booking-icon svg{width:21px;height:21px}
@media(hover:hover){.p-thread :is(.p-chat-booking-bar,.p-chat-booking-event) .fc-athlete-booking-row:hover{background:var(--p-raised)}}
.p-chat-booking-event>.end{display:flex;gap:4px;align-items:center;justify-content:flex-end;padding:2px 6px 0;color:var(--p-text-2);font-size:11px}
.p-refcard .art { border-radius: 14px; overflow: hidden; min-height: 92px; }
.p-refcard .body { display: grid; align-content: center; gap: 4px; padding: 4px 0; min-width: 0; }
.p-refcard .body small.k { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--p-text-2); }
.p-refcard .body b { font-size: 16px; font-weight: 700; }
.p-refcard .body .p-cap { font-size: 13px; }
.p-refcard .end { display: grid; align-content: space-between; justify-items: end; padding: 6px 6px 2px 0; color: var(--p-text-2); }
.p-refcard .end svg { width: 20px; height: 20px; }
.p-refcard .end time { font-size: 11.5px; }
/* Coaching assignments use compact text; actual media reference cards keep their preview layout. */
.p-refcard.text-first { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 12px 14px; box-shadow: none; }
.p-refcard.coaching .body small.k { font-size: 13px; font-weight: 500; line-height: 18px; letter-spacing: 0; text-transform: none; }
.p-refcard.coaching .body b { font-size: 17px; font-weight: 600; line-height: 23px; }
.p-refcard.coaching .body .p-cap { font-size: 14px; line-height: 20px; }
.p-refcard .bar { height: 7px; border-radius: 7px; background: var(--p-raised); overflow: hidden; margin-top: 4px; }
.p-refcard .bar i { display: block; height: 100%; background: linear-gradient(90deg, #9EDB4E, #C9F25B); border-radius: inherit; }
.p-voice { display: flex; align-items: center; gap: 10px; min-width: 230px; }
.p-voice .play { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 0; background: var(--p-blue); color: #fff; cursor: pointer; flex: none; }
.p-voice .play svg { width: 20px; height: 20px; }
.p-wave { display: flex; align-items: center; gap: 2px; height: 30px; flex: 1 1 auto; }
.p-wave i { flex: 1 1 0; min-width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--p-blue) 60%, transparent); }
.p-wave i.on { background: var(--p-blue); }
.p-coach-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 8px; }
.p-coach-actions button { display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 8px 10px; border: 1px solid var(--p-line); border-radius: 18px; background: var(--p-card); color: var(--p-text); font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1.2; text-align: left; cursor: pointer; }
.p-coach-actions .ico { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; }
.p-coach-actions .ico svg { width: 22px; height: 22px; }
.p-coach-actions .a1 .ico { background: var(--p-lime); color: var(--p-lime-ink); }
.p-coach-actions .a2 .ico { background: var(--p-lav-soft); color: var(--p-lav-text); }
.p-coach-actions .a3 .ico { background: var(--p-blue); color: #fff; }
.p-coach-actions .a1 { color: color-mix(in srgb, var(--p-lime-text) 100%, var(--p-text)); }
.p-coach-actions .a3 { color: var(--p-blue-text); }
.p-composer { display: grid; grid-template-columns: 44px minmax(0, 1fr) 56px; align-items: end; gap: 8px; padding: 10px 0 2px; }
.p-composer .box { display: flex; align-items: flex-end; gap: 4px; min-height: 44px; padding: 0 6px 0 14px; border: 1px solid var(--p-line); border-radius: 26px; background: var(--p-raised); }
.p-composer textarea { flex: 1 1 auto; min-width: 0; min-height: 42px; max-height: 140px; padding: 10px 0; border: 0; background: transparent; color: var(--p-text); font: inherit; font-size: 16px; line-height: 22px; resize: none; outline: none; }
.p-composer .p-iconbtn { background: transparent; }
.p-composer .send { width: 56px; height: 52px; border-radius: 18px; border: 0; display: grid; place-items: center; background: var(--p-lime); color: var(--p-lime-ink); cursor: pointer; transition: transform .14s ease; }
.p-composer .send:active { transform: scale(.94); }
.p-composer .send svg { width: 24px; height: 24px; }
.p-composer .send.rec { background: var(--p-danger); color: #fff; animation: p-pulse 1.1s ease-in-out infinite; }
@keyframes p-pulse { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--p-danger) 20%, transparent); } }
.p-replybar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-left: 3px solid var(--p-blue-2); border-radius: 12px; background: var(--p-raised); font-size: 13.5px; margin-top: 8px; }
.p-replybar .p-grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes p-msg-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }

@media (min-width: 1000px) {
  .p-chat-split { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: start; }
  .p-chat-split .p-thread { position: sticky; top: 20px; height: calc(100dvh - 60px); padding: 14px 18px; border: 1px solid var(--p-line); border-radius: 26px; background: var(--p-card-2); }
  .p-thread { height: calc(100dvh - 60px); }
}

/* ===================== питание ===================== */
.p-person { display: flex; align-items: center; gap: 12px; }
.p-person .who b { display: block; font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
.p-person .who small { display: block; font-size: 13.5px; color: var(--p-text-2); }
.p-cal-card .layout { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; }
.p-datepill { display: inline-flex; align-items: center; gap: 6px; }
.p-datepill span { min-height: 34px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--p-raised); font-size: 12.5px; font-weight: 600; }
.p-meal-tl { display: grid; gap: 10px; position: relative; }
.p-meal-row { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 10px; align-items: center; position: relative; }
.p-meal-row .t { display: grid; justify-items: start; gap: 8px; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; position: relative; }
.p-meal-row .chk { position: absolute; left: 50px; transform: translateX(-60%); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--p-line-strong); background: var(--p-card); z-index: 1; }
.p-meal-row .chk.on { border-color: var(--p-lime-2); background: var(--p-lime-2); color: var(--p-lime-ink); }
.p-meal-row .chk svg { width: 15px; height: 15px; }
.p-meal { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-left: 14px; padding: 8px 8px 8px 8px; border: 1px solid var(--p-line); border-radius: 22px; background: var(--p-card); text-align: left; font: inherit; color: var(--p-text); cursor: pointer; width: calc(100% - 14px); }
.p-meal .ph { width: 92px; height: 92px; border-radius: 16px; overflow: hidden; }
.p-meal b { display: block; font-size: 16px; font-weight: 700; }
.p-meal .k { font-size: 15.5px; font-weight: 650; margin-top: 2px; }
.p-meal .m { display: flex; gap: 14px; font-size: 13px; color: var(--p-text-2); margin-top: 6px; }
.p-meal .end { display: grid; align-content: space-between; height: 100%; padding: 4px 4px 4px 0; color: var(--p-text-2); justify-items: end; }
.p-meal .end svg { width: 20px; height: 20px; }
.p-meal.planned { opacity: .78; border-style: dashed; }
.p-meal-tl::before { content: ""; position: absolute; left: 49px; top: 24px; bottom: 24px; width: 2px; background: var(--p-line-strong); }
.p-food-ph { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(145deg, #FFE7C2, #FDCB8F); color: #9B5A12; }
.p-food-ph svg { width: 40%; height: 40%; }
.p-food-ph[data-m="lunch"] { background: linear-gradient(145deg, #DFF6C6, #B9E58F); color: #3D6B12; }
.p-food-ph[data-m="snack"] { background: linear-gradient(145deg, #E9E3FF, #CBBFFD); color: #4A3BA8; }
.p-food-ph[data-m="dinner"] { background: linear-gradient(145deg, #FFD9CF, #F9AF9B); color: #8E3519; }
.p-sum { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 10px; }
.p-sum .p-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.p-dots-m { display: flex; gap: 12px; font-size: 13px; }
.p-dots-m span { display: grid; gap: 2px; justify-items: center; color: var(--p-text-2); }
.p-dots-m b { color: var(--p-text); font-size: 15px; display: inline-flex; align-items: center; gap: 5px; }
.p-dots-m b::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.p-acts3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.p-acts3 button { display: flex; align-items: center; gap: 10px; min-height: 70px; padding: 10px 12px; border: 1px solid var(--p-line); border-radius: 20px; background: var(--p-card); color: var(--p-text); font: inherit; font-size: 13px; font-weight: 600; line-height: 1.2; text-align: left; cursor: pointer; }
.p-acts3 button.lime { background: var(--p-lime); border-color: var(--p-lime); color: var(--p-lime-ink); }
.p-acts3 svg { width: 28px; height: 28px; flex: none; }

/* ===================== прогресс ===================== */
.p-weight-big { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 8px; }
.p-weight-big b { font-size: 50px; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.p-weight-big span { font-size: 20px; font-weight: 700; }
.p-delta { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--p-lav-soft); color: var(--p-lav-text); font-size: 15px; font-weight: 600; }
:root[data-theme="dark"] .p-delta { background: rgba(140, 130, 255, .22); color: #D8D5FF; }
.p-delta svg { width: 17px; height: 17px; }
.p-scale5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.p-scale5 button { min-height: 52px; border: 1.5px solid var(--p-line); border-radius: 16px; background: var(--p-card); font: inherit; font-size: 20px; cursor: pointer; }
.p-scale5 button[aria-pressed="true"] { border-color: var(--p-lime-2); background: var(--p-lime); }
.p-meas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.p-meas div, .p-meas > button { padding: 12px; border: 1px solid var(--p-line); border-radius: 18px; background: var(--p-card); }
:root[data-theme="dark"] .p-meas div, :root[data-theme="dark"] .p-meas > button { background: transparent; border-color: var(--p-line-strong); }
.p-meas > button { font: inherit; text-align: left; color: inherit; cursor: pointer; min-height: 44px; }
.p-meas small { display: block; font-size: 13px; color: var(--p-text-2); }
.p-meas b { display: block; font-size: 19px; font-weight: 700; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.p-meas em { display: inline-flex; align-items: center; gap: 3px; font-style: normal; font-size: 14px; font-weight: 600; color: var(--p-ok); }
.p-meas em svg { width: 15px; height: 15px; }
.p-hist { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 0; }
.p-hist + .p-hist { border-top: 1px solid var(--p-line); }
.p-hist .d { display: grid; justify-items: center; padding: 8px 0; border-radius: 14px; background: var(--p-raised); }
.p-hist .d b { font-size: 20px; font-weight: 700; line-height: 1; }
.p-hist .d small { font-size: 12px; color: var(--p-text-2); margin-top: 3px; }

/* ===================== плеер тренировки ===================== */
.p-player-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.p-timer { font-size: 15px; font-weight: 700; padding: 8px 14px; border-radius: 999px; background: var(--p-raised); font-variant-numeric: tabular-nums; }
.p-sets { display: grid; gap: 8px; }
.p-set { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr) 52px; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--p-line); border-radius: 16px; background: var(--p-card); }
.p-set .n { font-weight: 700; text-align: center; color: var(--p-text-2); }
.p-set input { min-height: 44px; text-align: center; font-size: 17px; font-weight: 650; }
.p-set .ok { width: 48px; height: 44px; border-radius: 14px; border: 1.5px solid var(--p-line-strong); background: var(--p-card); display: grid; place-items: center; cursor: pointer; color: var(--p-text-3); transition: background .15s ease, transform .15s ease; }
.p-set .ok svg { width: 22px; height: 22px; }
.p-set.done .ok { background: var(--p-lime); border-color: var(--p-lime); color: var(--p-lime-ink); }
.p-set.done { background: color-mix(in srgb, var(--p-lime) 10%, var(--p-card)); }
.p-progressbar { height: 8px; border-radius: 8px; background: var(--p-raised); overflow: hidden; }
.p-progressbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--p-blue-2), var(--p-blue)); transition: width .5s ease; }
.p-rest { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 20px; background: var(--p-blue); color: #fff; }
.p-rest b { font-size: 26px; font-variant-numeric: tabular-nums; }
.p-exnav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.p-exnav button { flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--p-line); background: var(--p-card); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--p-text-2); }
.p-exnav button[aria-current="true"] { background: var(--p-blue); border-color: var(--p-blue); color: #fff; }
.p-exnav button > span { display: inline-block; max-width: 19ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.p-exnav button.done::after { content: " ✓"; }

/* ===================== листы (bottom sheet) и меню действий ===================== */
dialog { border-radius: 28px; background: var(--p-card); color: var(--p-text); border: 1px solid var(--p-line); }
dialog::backdrop { background: rgba(10, 14, 40, .42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog .modal-head h2 { font-size: 20px; font-weight: 750; }
dialog .btn.primary { background: var(--p-lime); border-color: var(--p-lime); color: var(--p-lime-ink); }
.btn { border-radius: 14px; }
.btn.primary { background: var(--p-lime); border-color: var(--p-lime); color: var(--p-lime-ink); }
@media (max-width: 860px) {
  dialog { border-radius: 28px 28px 0 0; }
  dialog[open] { animation: p-sheet-in .28s cubic-bezier(.2, .9, .25, 1); }
}
@keyframes p-sheet-in { from { transform: translateY(40px); opacity: .4; } }
.p-sheet-list { display: grid; gap: 4px; }
.p-sheet-list button { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 8px 12px; border: 0; border-radius: 16px; background: transparent; color: var(--p-text); font: inherit; font-size: 16px; font-weight: 550; text-align: left; cursor: pointer; }
.p-sheet-list button:hover { background: var(--p-raised); }
.p-sheet-list button svg { width: 22px; height: 22px; color: var(--p-text-2); }
.p-sheet-list button.danger, .p-sheet-list button.danger svg { color: var(--p-danger); }
.p-pick { display: grid; gap: 6px; max-height: 50vh; overflow-y: auto; }
.p-pick button { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 12px; border: 1.5px solid var(--p-line); border-radius: 18px; background: var(--p-card); color: var(--p-text); font: inherit; text-align: left; cursor: pointer; }
.p-pick button[aria-pressed="true"] { border-color: var(--p-blue); background: var(--p-blue-soft); }
.p-wd { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.p-wd button { min-height: 44px; border: 1.5px solid var(--p-line); border-radius: 14px; background: var(--p-card); font: inherit; font-weight: 650; cursor: pointer; color: var(--p-text); }
.p-wd button[aria-pressed="true"] { background: var(--p-blue); border-color: var(--p-blue); color: #fff; }
.p-confirm { display: grid; gap: 10px; padding: 14px; border-radius: 18px; background: var(--p-raised); }
.p-confirm div { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.p-confirm div span { color: var(--p-text-2); }
.p-confirm div b { text-align: right; }
.p-success { display: grid; justify-items: center; gap: 10px; padding: 18px 8px; text-align: center; }
.p-success .ok { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--p-lime); color: var(--p-lime-ink); animation: p-pop .45s cubic-bezier(.2, 1.4, .3, 1); }
.p-success .ok svg { width: 36px; height: 36px; }
@keyframes p-pop { from { transform: scale(.4); opacity: 0; } }

/* ===================== переходы страниц ===================== */
.p-page { animation: p-page-in .32s cubic-bezier(.2, .8, .2, 1) both; }
.p-page > * { animation: p-rise .42s cubic-bezier(.2, .8, .2, 1) both; }
.p-page > *:nth-child(2) { animation-delay: .03s; } .p-page > *:nth-child(3) { animation-delay: .06s; }
.p-page > *:nth-child(4) { animation-delay: .09s; } .p-page > *:nth-child(5) { animation-delay: .12s; }
.p-page > *:nth-child(6) { animation-delay: .15s; } .p-page > *:nth-child(7) { animation-delay: .18s; }
.p-page > *:nth-child(n+8) { animation-delay: .2s; }
@keyframes p-page-in { from { opacity: 0; } }
@keyframes p-rise { from { opacity: 0; transform: translateY(10px); } }
.p-swap { animation: p-rise .3s cubic-bezier(.2, .8, .2, 1) both; }
.p-collapse { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .3s cubic-bezier(.2, .8, .2, 1); }
.p-collapse > div { overflow: hidden; min-height: 0; }
.p-collapse.closed { grid-template-rows: 0fr; }
.p-rot { transition: transform .25s ease; }
.p-rot.closed { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
  .p-page, .p-page > *, .p-msg, .p-refcard, .p-swap, dialog[open], .p-success .ok { animation: none !important; }
  .p-ring .val, .p-macro .bar i, .p-bars i, .p-collapse { transition: none !important; }
}

/* ===================== адаптив ===================== */
@media (max-width: 380px) {
  .p-display { font-size: 30px; }
  .p-hero-at h2 { font-size: 26px; }
  .p-grid-3 .p-kpi { padding: 10px; gap: 8px; }
  .p-kpi .ico { width: 34px; height: 34px; }
  .p-ex { grid-template-columns: 18px 56px minmax(0, 1fr) auto; }
  .p-ex .thumb { width: 56px; height: 56px; }
  .p-ex .tools { grid-column: 2 / -1; justify-content: flex-end; }
  .p-cal button { width: 38px; height: 38px; }
  .p-meal { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .p-meal .ph { width: 72px; height: 72px; }
}
@media (min-width: 861px) {
  .p-page { --gap: 16px; }
  .p-top .p-brand { display: none; }
  .p-desk-2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .p-desk-2 > div { display: grid; gap: 16px; min-width: 0; }
  .p-desk-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .p-display { font-size: 40px; }
  .p-sticky { bottom: 18px; }
  .p-thread { height: calc(100dvh - 60px); }
  .p-lib-strip { grid-auto-columns: minmax(240px, 32%); }
}
@media (min-width: 1280px) { main { max-width: 1320px; } }

/* ===================== v13: прогресс, план, плеер ===================== */
.p-stack { display: grid; gap: var(--gap, 12px); min-width: 0; }
.p-stack > * { min-width: 0; }
.p-desk-2 { display: grid; gap: var(--gap, 12px); }
.p-desk-2 > div { display: grid; gap: var(--gap, 12px); min-width: 0; align-content: start; }
.p-row.center { justify-content: center; }
.p-hello-act { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.p-hello-act .p-sub { margin: 6px 0 0; max-width: 300px; }
.p-hello-act > .p-btn { align-self: center; }
.p-delta.muted { background: var(--p-raised); color: var(--p-text-2); }
.p-reg-top { display: flex; align-items: center; gap: 14px; margin: -2px 0 12px; }
.p-reg-num { font-size: 50px; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.p-reg-t { font-size: 19px; font-weight: 700; }
.p-reg-m { align-self: flex-end; font-size: 14px; }
.p-legend { margin-top: 12px; }
.p-qtile { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; border: 1px solid var(--p-line); border-radius: 22px; background: var(--p-card); color: var(--p-text); font: inherit; font-size: 14.5px; font-weight: 600; text-align: left; cursor: pointer; box-shadow: var(--p-shadow); }
.p-qtile .ico { color: var(--p-blue); display: grid; place-items: center; }
.p-qtile .ico svg { width: 30px; height: 30px; }
.p-qtile > svg { width: 18px; height: 18px; color: var(--p-text-2); flex: none; }
.p-qtile:active { transform: scale(.98); }
.p-kpi3 { gap: 8px; }
.p-kpi-v { align-items: flex-start; padding: 12px 10px; gap: 8px; border-radius: 20px; box-shadow: var(--p-shadow); }
.p-kpi-v .ico.plain { width: 30px; height: 30px; color: var(--p-blue); }
.p-kpi-v .ico.plain svg { width: 28px; height: 28px; }
.p-kpi-v b { font-size: 21px; }
.p-kpi-v b small { font-size: 13px; font-weight: 600; }
.p-kpi-v em { display: flex; align-items: center; gap: 2px; font-style: normal; font-size: 13px; font-weight: 650; color: var(--p-ok); }
.p-kpi-v em.up { color: var(--p-warn); }
.p-kpi-v em svg { width: 14px; height: 14px; }
.p-kpi-v span { font-size: 12.5px; }
.p-hist { width: 100%; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.p-hist-t { font-size: 16px; font-weight: 650; }
.p-meas em.up { color: var(--p-warn); }
.p-meas em.none { color: var(--p-text-3); font-weight: 500; font-size: 12px; }
.p-table-wrap { overflow-x: auto; margin: 0 -4px; }
.p-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.p-table th, .p-table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--p-line); white-space: nowrap; }
.p-table th { font-size: 12.5px; color: var(--p-text-2); font-weight: 600; }
.p-week-range { font-size: 16px; font-weight: 700; }
.p-wcard { display: grid; gap: 10px; }
.p-exlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.p-exlist li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--p-raised); font-size: 14px; }
.p-exlist li small { color: var(--p-text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.p-exlist li.more { justify-content: center; color: var(--p-text-2); font-size: 13px; }
.p-assign { display: grid; gap: 10px; }
.p-wo-hero { min-height: 250px; }
.p-paused-in { display: inline-flex; align-items: center; gap: 8px; width: max-content; max-width: 100%; margin-top: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .6); font-size: 13px; font-weight: 600; }
.p-paused-in svg { width: 16px; height: 16px; }
.p-coachnote { display: grid; gap: 6px; }
.p-coachnote svg { width: 18px; height: 18px; color: var(--p-blue-text); }
.p-coachnote p { margin: 0; color: var(--p-text-2); white-space: pre-wrap; }
.p-coachnote-in { display: flex; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: var(--p-lav-soft); color: var(--p-lav-text); font-size: 13.5px; line-height: 1.35; }
:root[data-theme="dark"] .p-coachnote-in { background: rgba(140, 130, 255, .16); color: #D8D5FF; }
.p-coachnote-in svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.p-wo-ex .thumb { width: 52px; height: 52px; flex: none; border-radius: 14px; overflow: hidden; }
.p-wo-ex .meta { white-space: normal; }
.p-fact { color: var(--p-ok) !important; font-weight: 600; }
.p-ok-dot { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--p-lime); color: var(--p-lime-ink); }
.p-ok-dot svg { width: 16px; height: 16px; }
.p-quote { margin: 12px 0 0; padding: 10px 14px; border-left: 3px solid var(--p-lime-2); border-radius: 10px; background: var(--p-raised); font-size: 14.5px; }
.p-player { padding-top: 4px; }
.p-player-top b { font-size: 16px; }
.p-player-top small { display: block; }
.p-wo-cur .p-media { min-height: 170px; }
.p-set.head { padding: 0 8px; border: 0; background: transparent; min-height: 0; font-size: 12px; font-weight: 600; color: var(--p-text-2); text-align: center; }
.p-set.head span:first-child { text-align: center; }
.p-wo-nav .p-btn[disabled] { opacity: .45; }
.p-wo-nav { position: sticky; bottom: calc(var(--tabbar-h, 0px) + 14px + var(--safe-b, 0px)); z-index: 5; padding: 8px; border-radius: 24px; background: color-mix(in srgb, var(--p-bg) 80%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
body[data-route="workout"] .p-wo-nav { bottom: calc(14px + var(--safe-b, 0px)); }
.p-kpi-v { padding: 12px 8px; gap: 6px; }
.p-kpi-v .ico.plain { width: 24px; height: 26px; }
.p-kpi-v .ico.plain svg { width: 24px; height: 24px; }
.p-kpi-v > div { min-width: 0; }
.p-kpi-v b { font-size: 19px; white-space: nowrap; }
.p-kpi-v span { font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.p-meas div, .p-meas > button { padding: 10px 9px; }
.p-meas b { font-size: 17px; white-space: nowrap; }
.p-meas em { white-space: nowrap; font-size: 13px; }
.p-hist { gap: 10px; }
.p-item .p-grow, .p-row .p-grow { min-width: 0; }
.p-item > .p-btn, .p-item > .p-chip { flex: none; }
.p-exlist li { align-items: center; }
.p-list > * { min-width: 0; }
.p-item .title { overflow-wrap: anywhere; }
/* иконка без явного размера не раздувается до ширины контейнера (нулевая специфичность — любые правила компонентов главнее) */
:where(.p-page, .p-player, dialog) svg:where(:not([width])) { width: 20px; height: 20px; flex: none; }
.p-rows > * { min-width: 0; }
.p-kpi > div { min-width: 0; }
.p-kpi span { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) {
  .p-grid-3 .p-kpi { padding: 10px 8px; gap: 7px; }
  .p-grid-3 .p-kpi .ico { width: 32px; height: 32px; border-radius: 11px; }
  .p-grid-3 .p-kpi .ico svg { width: 18px; height: 18px; }
  .p-grid-3 .p-kpi b { font-size: 19px; }
  .p-grid-3 .p-kpi span { font-size: 11px; line-height: 1.2; }
}
.p-qa button > div { min-width: 0; }
.p-qa b, .p-qa small { -webkit-hyphens: auto; hyphens: auto; overflow-wrap: break-word; }
@media (max-width: 420px) {
  .p-qa button { padding: 10px 8px; gap: 7px; min-height: 70px; }
  .p-qa .ico { width: 32px; height: 32px; border-radius: 10px; }
  .p-qa .ico svg { width: 19px; height: 19px; }
  .p-qa b { font-size: 12.5px; }
  .p-qa small { font-size: 10.5px; }
}
/* конструктор на телефоне: строка упражнения как в макете — ручка, фото, название, дозировка, действия */
.p-ctx .p-btn { white-space: normal; max-width: 132px; line-height: 1.15; text-align: left; height: auto; min-height: 44px; padding: 6px 12px; }
.p-ctx .who b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-sticky .p-btn { padding: 0 12px; font-size: 14.5px; min-width: 0; }
.p-sticky .p-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) {
  .p-wo.p-card, .p-card.p-wo { padding: 14px 10px; }
  .p-ex { grid-template-columns: 14px 56px minmax(0, 1fr) auto auto; gap: 7px; min-height: 80px; padding: 8px 2px 8px 2px; border-radius: 18px; }
  .p-ex .grip svg { width: 15px; height: 15px; }
  .p-ex .thumb { width: 56px; height: 56px; border-radius: 12px; }
  .p-ex .name { font-size: 14px; }
  .p-ex .note { font-size: 11.5px; }
  .p-ex .dose span { min-width: 50px; padding: 4px 5px; font-size: 13px; }
  .p-ex .dose span.rpe { font-size: 11.5px; }
  .p-ex .tools { grid-column: auto; }
  .p-ex .tools button { width: 24px; height: 36px; }
  .p-ex .tools svg { width: 17px; height: 17px; }
  .p-sticky .p-btn svg { display: none; }
}
.p-item .thumb { width: 52px; height: 52px; flex: none; border-radius: 14px; overflow: hidden; }
.p-badge { min-width: 24px; height: 24px; padding: 0 7px; flex: none; display: inline-grid; place-items: center; border-radius: 999px; background: var(--p-lav-soft); color: var(--p-lav-text); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .p-badge { background: var(--p-lav); color: #1C1650; }
button.p-card { font: inherit; color: inherit; text-align: left; width: 100%; cursor: pointer; }
@media (max-width: 420px) {
  .p-grid-3 .p-kpi .ico { width: 28px; height: 28px; border-radius: 9px; }
  .p-grid-3 .p-kpi .ico svg { width: 16px; height: 16px; }
  .p-grid-3 .p-kpi span { text-overflow: clip; font-size: 10.5px; }
  .p-actions .p-btn.sm { font-size: 12.5px; padding: 0 8px; gap: 5px; }
  .p-actions .p-btn.sm svg { width: 16px; height: 16px; }
  .p-sticky { gap: 8px; padding: 8px; }
  .p-sticky .p-btn { font-size: 13.5px; padding: 0 8px; }
}
/* питание на телефоне: плотность как в макете 390 pt */
@media (max-width: 480px) {
  .p-cal-card { padding: 14px; }
  .p-cal-card .p-card-head { align-items: flex-start; gap: 6px; }
  .p-cal-card .p-card-head h3 { font-size: 16.5px; white-space: nowrap; }
  .p-cal-card .p-card-head .p-cap { font-size: 12px; }
  .p-datepill { gap: 4px; flex: none; }
  .p-datepill span { min-height: 30px; padding: 0 9px; font-size: 11px; white-space: nowrap; }
  .p-datepill .p-iconbtn { width: 30px; height: 30px; }
  .p-cal-card .layout { grid-template-columns: 132px minmax(0, 1fr); gap: 14px; }
  .p-cal-card .p-ring { width: 132px !important; height: 132px !important; }
  .p-cal-card .p-ring svg { width: 132px; height: 132px; }
  .p-cal-card .p-ring .ctr b { font-size: 30px; }
  .p-cal-card .p-ring .ctr span { font-size: 11.5px; }
  .p-macro .top { font-size: 12.5px; white-space: nowrap; }
  .p-macro .top b { font-size: 13.5px; }
  .p-macro .top small { font-size: 11px; }
  .p-macro .pct { width: 32px; font-size: 11.5px; }
  .p-card.tight { padding: 12px; }
  .p-card.tight .p-kpi .ico { width: 34px; height: 34px; }
  .p-card.tight b { white-space: nowrap; }
  .p-card.tight .p-ring { width: 62px !important; height: 62px !important; flex: none; }
  .p-card.tight .p-ring svg { width: 62px; height: 62px; }
  .p-card.tight .p-ring .ctr b { font-size: 15px; }
  .p-vpill b { font-size: 13.5px; white-space: nowrap; }
  .p-vpill small { font-size: 10.5px; }
  .p-acts3 button { gap: 6px; padding: 8px; min-height: 62px; font-size: 11.5px; }
  .p-acts3 svg { width: 22px; height: 22px; }
  .p-acts3 span { min-width: 0; overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }
  .p-meal-row { grid-template-columns: 42px minmax(0, 1fr); gap: 8px; }
  .p-meal-row .t { font-size: 12px; }
  .p-meal-row .chk { left: 44px; transform: none; width: 24px; height: 24px; }
  .p-meal-tl::before { left: 55px; }
  .p-meal { margin-left: 26px; width: calc(100% - 26px); grid-template-columns: 70px minmax(0, 1fr) auto; gap: 10px; padding: 7px; border-radius: 20px; }
  .p-meal .ph { width: 70px; height: 70px; border-radius: 14px; }
  .p-meal b { font-size: 15px; }
  .p-meal .k { font-size: 14px; }
  .p-meal .m { gap: 10px; font-size: 12px; white-space: nowrap; }
  .p-sum { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .p-sum .p-card { padding: 10px; gap: 8px; }
  .p-dots-m b { white-space: nowrap; }
}
@media (max-width: 480px) {
  .p-cal-card .p-card-head > div:first-child { min-width: 0; }
  .p-cal-card .p-card-head h3 { font-size: 15.5px; }
  .p-card.tight > .p-row.between > b { font-size: 12.5px !important; white-space: normal; }
  .p-card.tight > .p-row.between > .p-chip { font-size: 11px; padding: 2px 7px; min-height: 22px; }
}
.p-next > .p-row.between:last-child { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.p-next > .p-row.between:last-child > .p-row { min-width: 0; }
.p-next > .p-row.between:last-child > .p-row > div { min-width: 0; }
.p-next > .p-row.between:last-child b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-next > .p-row.between:last-child .p-cap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-next .p-link { white-space: nowrap; font-size: 13px; }
.p-kpi-big span { font-size: 12.5px; line-height: 1.25; }
/* превью темы в профиле — палитра Pulse */
.t-light .tcp { background: #F4F7FE; } .t-light .tcp i:nth-child(1) { background: #DCFB7C; } .t-light .tcp i:nth-child(n+2) { background: #DDE3F7; }
.t-dark .tcp { background: #0F1524; } .t-dark .tcp i:nth-child(1) { background: #4A60FB; } .t-dark .tcp i:nth-child(n+2) { background: #252F4B; }
.t-system .tcp { background: linear-gradient(135deg, #F4F7FE 0 50%, #0F1524 50% 100%); }
.t-system .tcp i:nth-child(1) { background: linear-gradient(135deg, #DCFB7C 0 50%, #4A60FB 50% 100%); }
.t-system .tcp i:nth-child(n+2) { background: linear-gradient(90deg, #DDE3F7 0 50%, #252F4B 50% 100%); }
.theme-card:has(input:checked) { border-color: var(--p-blue); box-shadow: 0 0 0 3px var(--p-blue-soft); }
.tcp-name svg { color: var(--p-blue-text); }
.tcp-sub { white-space: normal; }
@media (min-width: 861px) {
  .p-desk-2 .p-qa { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .p-desk-2 .p-qa button { flex-direction: column; gap: 8px; min-height: 108px; }
  .p-desk-2 .p-qa b, .p-desk-2 .p-qa small { -webkit-hyphens: manual; hyphens: manual; overflow-wrap: normal; }
}
@media (max-width: 860px) {
  body[data-route="chat"] main:has(.p-thread) { padding-bottom: 0 !important; }
  .p-thread { height: calc(var(--vvh, 100dvh) - var(--tabbar-h) - 34px - var(--safe-b) - var(--safe-t, 0px)); }
  html.kb-open .p-thread { height: calc(var(--vvh, 100dvh) - 20px); }
}
@media (max-width: 480px) {
  .p-thread-head .p-ava { width: 44px; height: 44px; font-size: 15px; }
  .p-thread-head .who { min-width: 0; flex: 1 1 auto; }
  .p-thread-head .who b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .p-thread-head .who small { font-size: 12.5px; }
  .p-thread-head .p-iconbtn { width: 38px; height: 38px; }
  .p-refcard { grid-template-columns: 38% minmax(0, 1fr) auto; gap: 12px; }
  .p-refcard .art { min-height: 84px; max-height: 96px; }
  .p-refcard .body small.k { font-size: 9.5px; letter-spacing: .1em; }
  .p-refcard .body b { font-size: 14.5px; }
  .p-refcard .body .p-cap { font-size: 12px; }
  .p-coach-actions button { gap: 6px; padding: 7px 7px; min-height: 52px; font-size: 11px; }
  .p-coach-actions .ico { width: 32px; height: 32px; border-radius: 10px; }
  .p-coach-actions .ico svg { width: 18px; height: 18px; }
}

/* ===================== v13: вход и регистрация — карусель Pulse ===================== */
main.p-auth { max-width: none !important; padding: 0 !important; margin: 0; min-height: 100dvh; background: var(--p-bg); color: var(--p-text); display: grid; }
.p-auth-hero { position: relative; overflow: hidden; isolation: isolate; background: #0B0F1C; color: #fff; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.p-auth-hero .hero-slides { position: absolute; inset: 0; width: 100%; opacity: 0; transition: opacity .6s ease; -webkit-mask-image: none; mask-image: none; }
.p-auth-hero .hero-slides.is-ready { opacity: 1; }
.p-auth-hero .hero-slide img { filter: saturate(1.05) contrast(1.02); }
.p-auth-shade { position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 11, 22, .55) 0%, rgba(8, 11, 22, 0) 22%, rgba(8, 11, 22, 0) 42%, rgba(8, 11, 22, .72) 78%, rgba(8, 11, 22, .92) 100%),
              radial-gradient(120% 60% at 0% 100%, rgba(78, 93, 242, .38) 0%, rgba(78, 93, 242, 0) 60%); }
.p-auth-top { position: absolute; z-index: 5; top: calc(14px + var(--safe-t, 0px)); left: 20px; right: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.p-auth-brand { display: inline-flex; align-items: flex-start; gap: 0; color: #fff; text-decoration: none !important; font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.p-auth-brand .c { color: #9AA6FF; }
.p-auth-brand small { margin: 4px 0 0 5px; font-size: 9.5px; font-weight: 800; letter-spacing: .22em; color: var(--p-lime); }
.p-auth-hero .hero-pause { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22); background: rgba(10, 14, 30, .38); color: #fff; }
.p-auth-hero .hero-progress { position: absolute; z-index: 5; left: 20px; right: 20px; top: calc(66px + var(--safe-t, 0px)); display: flex; gap: 6px; cursor: pointer; }
.p-auth-hero .hero-progress i { flex: 1 1 0; width: auto; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .28); position: relative; overflow: hidden; }
.p-auth-hero .hero-progress i::before { content: ""; position: absolute; inset: -10px 0; }
.p-auth-hero .hero-progress i.done { background: rgba(255, 255, 255, .85); }
.p-auth-hero .hero-progress i.run::after { background: var(--p-lime); }
.p-auth-caption { position: absolute; z-index: 5; left: 20px; right: 20px; bottom: 54px; display: grid; min-height: 150px; pointer-events: none; }
.p-auth-caption .cap-inner { grid-area: 1 / 1; align-self: end; display: grid; gap: 8px; }
.p-auth-caption .cap-inner.in { animation: p-cap-in .5s cubic-bezier(.2, .8, .2, 1) both; }
.p-auth-caption .cap-inner.out { animation: p-cap-out .32s ease both; }
@keyframes p-cap-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes p-cap-out { to { opacity: 0; transform: translateY(-8px); } }
.p-auth-tag { justify-self: start; padding: 5px 12px; border-radius: 999px; background: var(--p-lime); color: #111406; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.p-auth-title { margin: 0; font-size: clamp(32px, 9.4vw, 46px); line-height: 1.02; font-weight: 800; letter-spacing: -.035em; color: #fff; text-wrap: balance; }
.p-auth-title em { font-style: normal; color: var(--p-lime); }
.p-auth-sub { margin: 0; max-width: 420px; font-size: 15px; line-height: 1.4; color: rgba(255, 255, 255, .82); }
.p-auth-sheet { position: relative; z-index: 6; display: grid; align-content: start; }
.p-auth-card { display: grid; gap: 14px; padding: 12px 20px calc(28px + var(--safe-b, 0px)); background: var(--p-bg); }
.p-auth-grab { display: none; }
.p-auth-head h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.p-auth-head p { margin: 4px 0 0; font-size: 14.5px; }
.p-auth-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--p-raised); isolation: isolate; }
.p-auth-tabs a { position: relative; z-index: 1; min-height: 44px; display: grid; place-items: center; border-radius: 999px; color: var(--p-text-2); font-weight: 650; font-size: 15px; text-decoration: none !important; transition: color .25s ease; }
.p-auth-tabs a[aria-selected="true"] { color: var(--p-lime-ink); }
.p-auth-tabs .ind { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--p-lime); box-shadow: 0 6px 16px rgba(160, 200, 40, .28); transition: transform .32s cubic-bezier(.2, .8, .2, 1); }
.p-auth-tabs[data-active="register"] .ind { transform: translateX(100%); }
.p-auth-form { animation: p-form-in .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes p-form-in { from { opacity: 0; transform: translateY(8px); } }
.p-auth-form .btn.primary { min-height: 54px; border-radius: 18px; font-size: 16.5px; font-weight: 750; background: var(--p-lime); border-color: var(--p-lime); color: var(--p-lime-ink); box-shadow: 0 10px 24px rgba(160, 200, 40, .28); }
.p-auth-form .input, .p-auth-form input.input, .p-auth-form input:not([type="checkbox"]):not([type="radio"]) { min-height: 52px; border-radius: 16px; background: var(--p-card); border-color: var(--p-line); font-size: 16px; }
.p-auth-form .role-card { border-radius: 20px; background: var(--p-card); border-color: var(--p-line); }
.p-auth-form .role-card[aria-pressed="true"] { border-color: var(--p-blue); background: var(--p-blue-soft); }
.p-auth-form .role-card .ico { background: var(--p-blue-soft); color: var(--p-blue-text); }
.p-auth-form .segmented button[aria-pressed="true"] { background: var(--p-card); color: var(--p-text); }
.p-auth-form a { color: var(--p-blue-text); }
.p-auth-foot { margin: 4px 0 0; text-align: center; font-size: 12.5px; color: var(--p-text-3); }
.p-auth-foot a { color: var(--p-text-2); }

@media (max-width: 860px) {
  main.p-auth { display: block; }
  .p-auth-hero { height: clamp(420px, 60svh, 600px); }
  .p-auth-sheet { margin-top: -28px; }
  .p-auth-card { border-radius: 30px 30px 0 0; padding-top: 10px; box-shadow: 0 -12px 30px rgba(8, 11, 22, .18); min-height: calc(40svh + 28px); }
  .p-auth-grab { display: block; justify-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--p-line-strong); margin-bottom: 4px; }
}
@media (min-width: 861px) {
  main.p-auth { grid-template-columns: minmax(0, 1.15fr) minmax(420px, 520px); min-height: 100dvh; }
  .p-auth-hero { position: sticky; top: 0; height: calc(100dvh - 32px); margin: 16px 0 16px 16px; border-radius: 32px; }
  .p-auth-caption { left: 40px; right: 40px; bottom: 48px; }
  .p-auth-title { font-size: clamp(44px, 4.6vw, 64px); }
  .p-auth-sub { font-size: 17px; }
  .p-auth-top { left: 32px; right: 24px; top: 28px; }
  .p-auth-hero .hero-progress { left: 32px; right: 32px; top: 84px; }
  .p-auth-sheet { align-content: center; padding: 32px 40px; }
  .p-auth-card { padding: 8px 0 24px; background: transparent; }
  .p-auth-head h1 { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .p-auth-caption .cap-inner.in, .p-auth-caption .cap-inner.out, .p-auth-form { animation: none !important; }
  .p-auth-tabs .ind { transition: none; }
}

/* ===================== v13: плавность как в Telegram ===================== */
/* Экран анимируется только при переходе; перерисовка/обновление данных — без движения.
   Анимируются только transform и opacity (композитор GPU), без пересчёта раскладки. */
.p-page, .p-page > * { animation: none; }
.p-enter-push { animation: p-push .28s cubic-bezier(.2, .85, .25, 1) backwards; }
.p-enter-pop { animation: p-pop .28s cubic-bezier(.2, .85, .25, 1) backwards; }
.p-enter-tab, .p-enter-fade { animation: p-tabfade .2s ease-out backwards; }
@keyframes p-push { from { opacity: 0; transform: translate3d(28px, 0, 0); } }
@keyframes p-pop { from { opacity: .2; transform: translate3d(-28px, 0, 0); } }
@keyframes p-tabfade { from { opacity: 0; transform: translate3d(0, 6px, 0); } }
html { scrollbar-gutter: stable; }
body { -webkit-tap-highlight-color: transparent; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
a, button, [role="button"], [role="tab"], label, summary, .p-item, .p-card.p-tap { touch-action: manipulation; }
.p-btn, .p-iconbtn, .p-item, .p-qtile, .p-kpi.p-tap, .p-tap, .p-prio, .p-qa button, .p-acts3 button, .p-conv, .nav-link { transition: transform .14s ease, background-color .18s ease, opacity .18s ease, box-shadow .18s ease; }
.p-btn:active, .p-iconbtn:active, .p-item:active, .p-qtile:active, .p-tap:active, .p-prio:active, .p-qa button:active, .p-acts3 button:active, .nav-link:active { transform: scale(.97); }
/* индикатор загрузки экрана — тонкая полоса сверху, без сдвига содержимого */
#route-loading { position: fixed; z-index: 400; top: 0; left: 0; right: 0; height: 3px; margin: 0; padding: 0; max-width: none; overflow: hidden; font-size: 0; color: transparent;
  background: linear-gradient(90deg, transparent 0, var(--p-lime) 35%, var(--p-blue) 65%, transparent 100%); background-size: 45% 100%; background-repeat: no-repeat; animation: p-loadbar 1s cubic-bezier(.4, 0, .2, 1) infinite; }
@keyframes p-loadbar { from { background-position: -50% 0; } to { background-position: 150% 0; } }
/* листы: открываются снизу по пружинной кривой и уезжают вниз при закрытии */
@media (max-width: 860px) {
  dialog[open] .modal { will-change: transform; }
  dialog[open] { animation: p-sheet-in2 .34s cubic-bezier(.2, .9, .25, 1) both; }
  dialog.closing { animation: p-sheet-out .22s cubic-bezier(.4, 0, 1, 1) forwards !important; }
  .sheet-handle { touch-action: none; cursor: grab; padding: 8px 0; }
}
@media (min-width: 861px) {
  dialog[open] { animation: p-pop-in .22s cubic-bezier(.2, .9, .25, 1) both; }
  dialog.closing { animation: p-pop-out .16s ease forwards !important; }
}
dialog::backdrop { transition: opacity .22s ease; }
dialog.closing::backdrop { opacity: 0; }
@keyframes p-sheet-in2 { from { transform: translate3d(0, 100%, 0); } }
@keyframes p-sheet-out { to { transform: translate3d(0, 100%, 0); } }
@keyframes p-pop-in { from { opacity: 0; transform: scale(.96); } }
@keyframes p-pop-out { to { opacity: 0; transform: scale(.97); } }
/* картинки и аватары проявляются, а не «выстреливают» */
.p-thumb img, .p-media img, .p-ava img, .p-meal .ph img { animation: p-img-in .3s ease both; }
@keyframes p-img-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .p-enter-push, .p-enter-pop, .p-enter-tab, .p-enter-fade, dialog[open], dialog.closing, #route-loading, .p-thumb img, .p-media img { animation: none !important; }
  .p-btn, .p-iconbtn, .p-item, .p-tap { transition: none; }
}
/* зоны нажатия не меньше 44 px по высоте (бренд, ручка перетаскивания) */
.p-top .p-brand { padding: 11px 0; margin: -11px 0; }
@media (max-width: 480px) {
  .p-ex { grid-template-columns: 24px 54px minmax(0, 1fr) auto auto; }
  .p-ex .grip { width: 24px; }
}
@media (max-width: 860px) {
  /* пять равных пунктов; подпись «Программы» помещается целиком и на 360 px */
  .shell .rail .nav-link { flex: 1 1 0; min-width: 0; padding-inline: 0; }
  .shell .rail .nav-label { font-size: clamp(10px, 2.75vw, 11.5px); letter-spacing: -.015em; overflow: visible; text-overflow: clip; white-space: nowrap; }
}
@media (max-width: 380px) {
  .shell .rail { padding: 5px; gap: 0; inset-inline: 8px; left: 8px; right: 8px; }
  .shell .rail .nav-label { font-size: 10px; letter-spacing: -.025em; }
}

/* =========================================================================
   Импорт таблиц (v13.2) — мастер «переезда» тренера: загрузка → распознавание →
   сопоставление → проверка → готово. Только токены Pulse: светлая и тёмная тема.
   ========================================================================= */
.p-imp-head { display: grid; gap: 6px; }
.p-imp-head .p-sub { margin: 0; max-width: 760px; }
.p-imp-steps { list-style: none; margin: 0; padding: 4px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; background: var(--p-raised); border-radius: 999px; justify-self: start; max-width: 100%; }
.p-imp-steps::-webkit-scrollbar { display: none; }
.p-imp-step { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 6px; border: 0; border-radius: 999px; background: transparent; color: var(--p-text-2); font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .2s ease, color .2s ease; }
.p-imp-step:disabled { cursor: default; opacity: 1; }
.p-imp-step .num { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 999px; background: var(--p-card); color: var(--p-text-2); font-size: 13px; font-weight: 800; flex: none; }
.p-imp-step .num svg { width: 16px; height: 16px; }
.p-imp-step.cur { background: var(--p-card); color: var(--p-text); box-shadow: var(--p-shadow); }
.p-imp-step.cur .num { background: var(--p-lime); color: var(--p-lime-ink); }
.p-imp-step.done { color: var(--p-text); }
.p-imp-step.done .num { background: var(--p-blue); color: #fff; }
:root[data-theme="dark"] .p-imp-step.cur { background: var(--p-raised-2); }
:root[data-theme="dark"] .p-imp-step .num { background: var(--p-raised-2); }
@media (max-width: 640px) { .p-imp-step:not(.cur) .lbl { display: none; } .p-imp-step:not(.cur) { padding: 0 6px; } }

.p-imp-cols { display: grid; gap: 16px; align-items: start; }
.p-imp-main, .p-imp-side, .p-imp-stack { display: grid; gap: 16px; min-width: 0; }
.p-imp-stack { gap: 12px; }
@media (min-width: 1000px) {
  .p-imp-cols { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); }
  .p-imp-cols > .p-imp-side.first { grid-row: 1; grid-column: 1 / 2; }
  .p-imp-cols:has(> .p-imp-side.first) { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
}
.p-imp-panel { display: grid; gap: 14px; }
.p-imp-upload { display: grid; gap: 16px; }
.p-imp-drop { display: grid; justify-items: center; gap: 10px; padding: 34px 18px; border: 2px dashed var(--p-line-strong); border-radius: 22px; background: var(--p-card-2); text-align: center; cursor: pointer; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.p-imp-drop:hover, .p-imp-drop.over { border-color: var(--p-blue); background: color-mix(in srgb, var(--p-blue-soft) 55%, var(--p-card)); }
.p-imp-drop.over { transform: scale(1.01); }
.p-imp-drop:focus-within { outline: 2px solid var(--p-blue); outline-offset: 2px; }
.p-imp-drop .ico { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 20px; background: var(--p-lav-soft); color: var(--p-lav-text); }
.p-imp-drop .ico svg { width: 28px; height: 28px; }
:root[data-theme="dark"] .p-imp-drop .ico { background: var(--p-blue-soft); color: var(--p-blue-text); }
.p-imp-drop b { font-size: 19px; letter-spacing: -.02em; }
.p-imp-or { display: flex; align-items: center; gap: 12px; color: var(--p-text-2); font-size: 13px; }
.p-imp-or::before, .p-imp-or::after { content: ""; flex: 1; height: 1px; background: var(--p-line); }
.p-imp-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.p-imp-inline > .p-input { flex: 1 1 220px; min-width: 0; width: auto; }
.p-imp-file .title { font-size: 15px; }
.p-imp-ext { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--p-lime-soft); color: #36450A; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.p-imp-ext.csv, .p-imp-ext.tsv, .p-imp-ext.txt { background: #E9DDFE; color: #4B2C91; }
.p-imp-ext.gs { background: #DCE7FF; color: #1D3C8F; }
.p-imp-ext svg { width: 20px; height: 20px; }
:root[data-theme="dark"] .p-imp-ext { background: var(--p-lime); color: #1B2408; }
:root[data-theme="dark"] .p-imp-ext.csv, :root[data-theme="dark"] .p-imp-ext.tsv, :root[data-theme="dark"] .p-imp-ext.txt { background: #B49FFC; color: #1E1247; }
:root[data-theme="dark"] .p-imp-ext.gs { background: #779CFC; color: #0B1A47; }
.p-imp-how { list-style: none; counter-reset: imp; margin: 4px 0 0; padding: 0; display: grid; gap: 14px; }
.p-imp-how li { counter-increment: imp; display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; }
.p-imp-how li::before { content: counter(imp); grid-row: span 2; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 999px; background: var(--p-lime); color: var(--p-lime-ink); font-weight: 800; font-size: 13px; }
.p-imp-how b { font-size: 15px; }
.p-imp-progress { display: grid; gap: 8px; }
.p-imp-progress[hidden] { display: none; }
.p-imp-progress i { display: block; height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--p-blue) 0%, var(--p-lime) 50%, var(--p-blue) 100%); background-size: 200% 100%; animation: p-imp-run 1.2s linear infinite; }
@keyframes p-imp-run { from { background-position: 200% 0; } to { background-position: 0 0; } }

/* листы */
.p-imp-sheets { display: grid; gap: 8px; }
.p-imp-sheet { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--p-line); border-radius: 20px; background: var(--p-card); color: inherit; font: inherit; text-align: left; cursor: pointer; min-width: 0; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.p-imp-sheet:active { transform: scale(.99); }
.p-imp-sheet.sel { border-color: var(--p-blue); box-shadow: 0 0 0 1px var(--p-blue); }
.p-imp-sheet b { min-width: 0; font-size: 15px; }
.p-imp-conf { display: flex; align-items: center; gap: 10px; min-width: 0; }
.p-imp-conf .bar { flex: 1; height: 6px; border-radius: 999px; background: var(--p-raised); overflow: hidden; }
.p-imp-conf .bar i { display: block; height: 100%; border-radius: inherit; background: var(--p-blue); transition: width .3s ease; }
.p-imp-conf .p-cap { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-imp-sheethead { display: grid; gap: 6px; justify-items: start; }
.p-imp-sheethead .p-sub { margin: 0; }
.p-imp-group { display: grid; gap: 8px; min-width: 0; }
.p-imp-group > b { font-size: 14px; }
.p-imp-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.p-imp-pills button { min-height: 40px; padding: 0 14px; border: 1px solid var(--p-line); border-radius: 999px; background: var(--p-card); color: var(--p-text-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: background .18s ease, color .18s ease, border-color .18s ease, transform .12s ease; }
.p-imp-pills button:active { transform: scale(.97); }
.p-imp-pills button[aria-checked="true"] { background: var(--p-lime); border-color: var(--p-lime); color: var(--p-lime-ink); }
.p-imp-pills.sm button { min-height: 36px; padding: 0 12px; font-size: 13px; }
:root[data-theme="dark"] .p-imp-pills button { background: transparent; border-color: var(--p-line-strong); color: var(--p-text); }
:root[data-theme="dark"] .p-imp-pills button[aria-checked="true"] { background: var(--p-lime); border-color: var(--p-lime); color: var(--p-lime-ink); }
.p-imp-num { width: 96px; flex: none; }
.p-imp-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.4; }
.p-imp-note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.p-imp-note.warn { background: var(--p-warn-bg); color: var(--p-warn); }
.p-imp-table td { white-space: normal; vertical-align: middle; }
.p-imp-table td:first-child { white-space: nowrap; }
.p-imp-table tr.dim td:not(:last-child) { opacity: .55; }
.p-imp-table .samples { min-width: 180px; }
.p-imp-colh { display: block; font-size: 12.5px; color: var(--p-text-2); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.p-imp-select { min-width: 210px; min-height: 40px; }
.p-imp-ex { display: inline-flex; align-items: center; max-width: 220px; min-height: 26px; margin: 2px 6px 2px 0; padding: 2px 9px; border-radius: 9px; background: var(--p-raised); font-size: 12.5px; font-weight: 600; font-family: ui-monospace, "SF Mono", Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-imp-raw summary { cursor: pointer; font-weight: 600; font-size: 14px; min-height: 32px; display: flex; align-items: center; }
.p-imp-rawt td { font-size: 12.5px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }

/* сопоставление */
.p-imp-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.p-imp-tools.wrap > .p-filter { flex: 1 1 auto; min-width: 0; }
.p-imp-toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; font-weight: 600; cursor: pointer; }
.p-switch { appearance: none; -webkit-appearance: none; position: relative; width: 44px; height: 26px; margin: 0; flex: none; border-radius: 999px; background: var(--p-raised-2); border: 1px solid var(--p-line); cursor: pointer; transition: background .2s ease; }
.p-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .22s cubic-bezier(.2, .85, .25, 1); }
.p-switch:checked { background: var(--p-blue); border-color: var(--p-blue); }
.p-switch:checked::after { transform: translateX(18px); }
.p-switch:focus-visible { outline: 2px solid var(--p-blue); outline-offset: 2px; }
.p-imp-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; border: 1px solid var(--p-line); border-radius: 20px; background: var(--p-card-2); min-width: 0; }
.p-imp-row .src, .p-imp-row .dst { display: grid; gap: 3px; justify-items: start; min-width: 0; }
.p-imp-row .src b, .p-imp-row .dst b { font-size: 15px; overflow-wrap: anywhere; }
.p-imp-row .arrow { display: none; color: var(--p-text-3); }
.p-imp-row .arrow svg { width: 20px; height: 20px; }
.p-imp-row .p-chip { white-space: normal; text-align: left; }
@media (min-width: 900px) {
  .p-imp-row { grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr) auto; align-items: center; }
  .p-imp-row .arrow { display: block; }
  .p-imp-row > .p-imp-pills, .p-imp-row > .p-imp-acts { justify-content: flex-end; max-width: 380px; }
}
.p-imp-chips { display: flex; flex-wrap: wrap; align-items: center; min-width: 0; max-width: 100%; }
.p-imp-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.p-imp-allgood { display: grid; justify-items: center; gap: 6px; padding: 24px 12px; text-align: center; }
.p-imp-allgood .ok { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 999px; background: var(--p-ok-bg); color: var(--p-ok); }

/* проверка */
.p-imp-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .p-imp-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.p-imp-kpi { display: grid; gap: 2px; padding: 16px; }
.p-imp-kpi b { font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.p-imp-issue { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--p-line); border-radius: 20px; background: var(--p-card-2); min-width: 0; transition: opacity .2s ease; }
.p-imp-issue b { font-size: 15px; overflow-wrap: anywhere; }
.p-imp-issue.solved { background: transparent; }
.p-imp-fix { width: 140px; flex: 0 1 140px; min-height: 38px; }
.p-imp-preview { display: grid; }
.p-imp-preview .it { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--p-line); }
.p-imp-preview .chg { justify-self: start; padding: 1px 7px; border-radius: 8px; background: var(--p-lav-soft); color: var(--p-text); }
:root[data-theme="dark"] .p-imp-preview .chg { background: var(--p-blue-soft); }
.p-imp-preview .note { color: var(--p-lav-text); }
:root[data-theme="dark"] .p-imp-preview .note { color: var(--p-blue-text); }
.p-imp-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.p-imp-rules li { display: flex; gap: 10px; align-items: flex-start; }
.p-imp-rules svg { width: 18px; height: 18px; flex: none; color: var(--p-ok); margin-top: 1px; }

/* нижняя панель мастера */
.p-imp-foot { position: sticky; bottom: calc(var(--tabbar-h, 0px) + 12px + var(--safe-b, 0px)); z-index: 30; }
.p-imp-foot[hidden] { display: none; }
.p-imp-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 10px 10px 18px; border: 1px solid var(--p-line); border-radius: 24px; background: color-mix(in srgb, var(--p-card) 94%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--p-shadow-lg); }
.p-imp-barinfo { display: grid; gap: 2px; min-width: 160px; }
.p-imp-barbtns { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.p-imp-saving { font-size: 12px; color: var(--p-text-3); min-height: 16px; }
.p-imp-saving.on { color: var(--p-blue-text); }
@media (max-width: 560px) { .p-imp-barbtns { width: 100%; flex-wrap: nowrap; } .p-imp-barbtns .p-btn { flex: 0 0 auto; padding: 0 14px; } .p-imp-barbtns .p-btn:last-child { flex: 1 1 auto; min-width: 0; } .p-imp-barbtns .p-btn span { overflow: hidden; text-overflow: ellipsis; } .p-imp-bar { padding: 8px 10px; gap: 6px; } .p-imp-barinfo { min-width: 0; width: 100%; padding-left: 6px; } }
@media (min-width: 861px) { .p-imp-foot { bottom: 16px; } }
.p-imp-overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--p-bg) 70%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: p-page-in .2s ease both; }
.p-imp-overlay .p-card { display: grid; justify-items: center; gap: 8px; text-align: center; max-width: 340px; padding: 26px; }
.p-imp-spin { width: 44px; height: 44px; border-radius: 999px; border: 4px solid var(--p-raised); border-top-color: var(--p-blue); animation: p-imp-rot .9s linear infinite; }
@keyframes p-imp-rot { to { transform: rotate(360deg); } }

/* готово */
.p-imp-hero { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; padding: 26px; border-radius: 28px; background: var(--p-prio-1); color: var(--p-prio-1-ink); }
.p-imp-hero .txt { display: grid; gap: 6px; max-width: 680px; min-width: 0; }
.p-imp-hero .eyebrow { font-size: 13px; font-weight: 700; }
.p-imp-hero h2 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.p-imp-hero p { margin: 0; font-size: 15px; line-height: 1.45; }
.p-imp-undone { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; background: var(--p-warn-bg); border-color: transparent; }
.p-imp-undone .p-sub { margin: 4px 0 0; color: var(--p-text); }
.p-imp-inv { cursor: pointer; }
.p-imp-inv input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--p-blue); }
.p-imp-inv .p-chip { flex: none; }
.p-imp-log { list-style: none; margin: 0; padding: 0; display: grid; }
.p-imp-log li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--p-line); font-size: 13.5px; line-height: 1.4; }
.p-imp-qrwrap { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.p-imp-qrwrap > .p-imp-stack { flex: 1 1 220px; }
.p-imp-qr { width: 196px; height: 196px; padding: 12px; flex: none; display: grid; place-items: center; border-radius: 20px; background: #fff; border: 1px solid var(--p-line); }
.p-imp-qr svg { width: 100%; height: 100%; }
.p-imp-qr .p-cap { color: #69728F; }
@media (prefers-reduced-motion: reduce) { .p-imp-progress i, .p-imp-spin { animation: none; } .p-imp-drop.over { transform: none; } }
.p-imp-head, .p-imp-head > .p-row, .p-imp-head .p-grow { min-width: 0; }
.p-imp-head .p-h1 { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .p-imp-head .p-h1 { font-size: 24px; }
  .p-imp-table thead { display: none; }
  .p-imp-table, .p-imp-table tbody { display: block; }
  .p-imp-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--p-line); }
  .p-imp-table td { padding: 0; border: 0; }
  .p-imp-table td.samples { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
  .p-imp-select { min-width: 0; width: 190px; }
  .p-imp-table-wrap, .p-imp-panel .p-table-wrap { margin: 0; }
}
.p-imp-panel > *, .p-imp-tools > *, .p-imp-group > * { min-width: 0; max-width: 100%; }
.p-imp-panel { min-width: 0; }
.p-imp-sheethead .p-chip, .p-imp-issue .p-chip, .p-imp-row .p-chip { white-space: normal; text-align: left; }

/* ===== v16: иллюстрации упражнений из методички ===== */
/* фон «студии» как на картинках; blurhash-заглушка — фоном, фото проявляется поверх */
.p-art { position: relative; width: 100%; height: 100%; background: #0C1323 center / cover no-repeat; overflow: hidden; }
.p-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .32s ease-out; -webkit-user-drag: none; user-select: none; }
.p-art.fit-contain img { object-fit: contain; }
.p-art.loaded img { opacity: 1; }
.p-art.failed img { display: none; }
.p-thumb .p-art, .thumb .p-art { border-radius: inherit; }
.p-art-hero { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 22px; overflow: hidden; background: #0C1323; cursor: zoom-in; }
.p-art-hero:focus-visible { outline: 3px solid var(--p-blue); outline-offset: 3px; }
.p-art-hero .p-art { position: absolute; inset: 0; }
.p-art-hero:hover .p-art-zoom { transform: scale(1.08); }
.p-art-badge, .p-art-zoom, .p-art-dots { position: absolute; background: rgba(6, 10, 20, .62); color: #fff; border-radius: 999px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.p-art-badge { left: 10px; top: 10px; padding: 4px 9px; font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.p-art-zoom { right: 10px; bottom: 10px; width: 36px; height: 36px; display: grid; place-items: center; transition: transform .2s ease; }
.p-art-zoom svg { width: 18px; height: 18px; }
.p-art-dots { left: 10px; bottom: 10px; display: flex; gap: 10px; padding: 6px 10px; font-size: 11.5px; font-weight: 600; }
.p-art-dots span { display: inline-flex; align-items: center; gap: 5px; }
.p-art-dots i, .p-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.p-art-wrap { position: relative; }
.p-art-wrap > .p-art-tech { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: rgba(6, 10, 20, .62); color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; backdrop-filter: blur(6px); }
.p-art-wrap > .p-art-tech svg { width: 16px; height: 16px; }
.p-legend[role="group"] { display: grid; gap: 6px; }
.p-legend[role="group"] p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--p-text-2); padding-left: 24px; position: relative; }
.p-legend[role="group"] p b { color: var(--p-text); }
.p-legend[role="group"] i { position: absolute; left: 0; top: 4px; width: 14px; height: 14px; }
.p-legend[role="group"] i.pri { background: #D4F65A; box-shadow: inset 0 0 0 1px rgba(12, 19, 35, .2); }
.p-legend[role="group"] i.sup { background: #C7B5FF; }
.p-legend[role="group"].dark p { color: rgba(255, 255, 255, .72); } .p-legend[role="group"].dark p b { color: #fff; }
.p-tech-cue { display: flex; gap: 10px; padding: 14px; border-radius: 18px; background: var(--p-lime-soft); color: #1F2A05; }
.p-tech-cue svg { flex: none; width: 20px; height: 20px; color: #36450A; }
.p-tech-cue .p-eyebrow { color: #36450A; } .p-tech-cue p { margin: 2px 0 0; }
:root[data-theme="dark"] .p-tech-cue { background: #BCD46E; color: #111406; }
.p-tech-steps h3 { margin: 0 0 10px; font-size: 17px; }
.p-tech-steps ol { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.p-tech-steps li { counter-increment: st; position: relative; padding: 0 0 14px 40px; }
.p-tech-steps li:last-child { padding-bottom: 0; }
.p-tech-steps li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--p-blue); color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.p-tech-steps li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 32px; bottom: 4px; width: 2px; border-radius: 1px; background: var(--p-line); }
.p-tech-steps p { margin: 2px 0 0; }
.p-tech-err { padding: 14px; border-radius: 18px; background: var(--p-danger-bg); }
.p-tech-err > b { color: var(--p-danger); }
.p-tech-err ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.p-tech-err li { display: flex; gap: 8px; align-items: flex-start; } .p-tech-err li svg { flex: none; width: 16px; height: 16px; margin-top: 3px; color: var(--p-danger); }
.p-tech-breath { display: flex; gap: 10px; padding: 14px; border-radius: 18px; background: var(--p-blue-soft); }
.p-tech-breath svg { flex: none; width: 19px; height: 19px; color: var(--p-blue-text, var(--p-blue)); } .p-tech-breath b { color: var(--p-blue-text, var(--p-blue)); } .p-tech-breath p { margin: 2px 0 0; }
/* каталог — сетка карточек */
.p-ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.p-ex-tile { display: grid; grid-template-rows: auto 1fr; padding: 0; border: 1px solid var(--p-line); border-radius: 20px; overflow: hidden; background: var(--p-card); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; content-visibility: auto; contain-intrinsic-size: 180px 200px; }
.p-ex-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(18, 23, 58, .12); }
.p-ex-tile:active { transform: scale(.97); }
.p-ex-tile:focus-visible { outline: 3px solid var(--p-blue); outline-offset: 2px; }
.p-ex-tile .pic { position: relative; aspect-ratio: 3 / 2; background: #0C1323; display: grid; place-items: center; gap: 4px; color: #8C9AD0; font-size: 12px; font-weight: 600; }
.p-ex-tile .pic svg { width: 34px; height: 34px; }
.p-ex-tile .pic .p-art { position: absolute; inset: 0; }
.p-ex-tile .pic .own { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 999px; background: var(--p-lime); color: var(--p-lime-ink, #111406); font-size: 12px; font-weight: 700; }
.p-ex-tile .txt { padding: 8px 10px 10px; display: grid; gap: 2px; align-content: start; }
.p-ex-tile .txt b { font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-ex-tile .txt span { font-size: 12.5px; color: var(--p-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* полноэкранный просмотр */
dialog.p-artview { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; color: #fff; background: rgba(12, 19, 35, var(--fade, 1)); display: grid; grid-template-rows: auto 1fr auto; animation: pav-in .22s ease-out; overscroll-behavior: contain; }
dialog.p-artview::backdrop { background: transparent; }
dialog.p-artview.closing { animation: pav-out .18s ease-in forwards; }
@keyframes pav-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes pav-out { to { opacity: 0; transform: scale(.98); } }
.p-av-top { display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 14px 6px; }
.p-av-top h2 { flex: 1; margin: 0; font-size: 17px; font-weight: 700; color: #fff; }
.p-av-x svg { width: 22px; height: 22px; }
dialog.p-artview:not([open]) { display: none; }
.p-av-x, .p-av-btn { border: 0; color: #fff; background: rgba(255, 255, 255, .14); cursor: pointer; font: inherit; }
.p-av-x { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.p-av-x:focus-visible, .p-av-btn:focus-visible { outline: 3px solid #D4F65A; outline-offset: 2px; }
.p-av-stage { position: relative; overflow: hidden; display: grid; place-items: center; touch-action: none; cursor: zoom-in; min-height: 0; }
.p-artview.zoomed .p-av-stage { cursor: grab; }
.p-av-pic { width: min(100vw, calc((100dvh - 230px) * 1.5), 1200px); max-height: 100%; will-change: transform; }
.p-av-pic .p-art { background-color: transparent; }
.p-av-foot { padding: 6px 18px max(14px, env(safe-area-inset-bottom)); display: grid; gap: 12px; max-width: 900px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.p-av-row { display: flex; align-items: center; gap: 10px; }
.p-av-hint { flex: 1; font-size: 12.5px; color: rgba(255, 255, 255, .6); }
.p-av-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.p-av-btn svg { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .p-art img, .p-ex-tile { transition: none; } dialog.p-artview, dialog.p-artview.closing { animation: none; } }
/* миниатюры 3:2 — на иллюстрациях обычно два кадра движения, квадрат обрезал бы их */
.p-wo-ex .thumb, .p-item .thumb { width: 78px; height: 52px; border-radius: 12px; }
.p-ex .thumb { width: 96px; height: 64px; border-radius: 12px; }
.p-lib-card { grid-template-columns: 84px minmax(0, 1fr) auto; }
.p-lib-card .thumb { width: 84px; height: 56px; }
button.p-wo-ex { cursor: pointer; }

/* ===== Главная как в приложении (карточка «Сейчас», полоса дня, короткие строки) — эталон mobile/src/screens/home.tsx ===== */
.p-now { min-height: 0; padding: 18px; gap: 6px; }
.p-now h2 { max-width: 78%; }
.p-now .sub { max-width: 78%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-now .art { opacity: .22; color: var(--p-hero-ink); right: 14px; top: 40px; bottom: auto; width: auto; }
.p-now .art svg { width: 104px; height: 104px; }
@media (max-width: 349px) { .p-now h2, .p-now .sub { max-width: 100%; } }
.p-mini { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px 14px; border-radius: 22px; background: var(--p-card); border: 1px solid var(--p-line); color: var(--p-text); text-align: left; font: inherit; cursor: pointer; }
.p-mini .ib { width: 40px; height: 40px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--p-blue-soft); color: var(--p-blue-text); }
.p-mini .ib svg { width: 20px; height: 20px; }
.p-mini > svg { width: 20px; height: 20px; color: var(--p-text-2); flex: none; }
.p-mini .p-grow { display: grid; min-width: 0; }
.p-mini b { font-weight: 700; }
.p-steps { display: grid; gap: 8px; }
.p-steps .bar { height: 8px; border-radius: 4px; background: var(--p-raised); overflow: hidden; }
.p-steps .bar i { display: block; height: 100%; background: var(--p-ok); border-radius: inherit; }
.p-steps .step { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 0; border: 0; background: transparent; color: var(--p-text); text-align: left; font: inherit; cursor: pointer; }
.p-steps .step .p-grow { display: grid; }
.p-steps .step .mark { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 2px solid var(--p-line-strong); display: grid; place-items: center; }
.p-steps .step.done { cursor: default; }
.p-steps .step.done .mark { border: 0; background: var(--p-ok); color: #fff; }
.p-steps .step.done .mark svg { width: 16px; height: 16px; }
.p-steps .step.done b { color: var(--p-text-3); text-decoration: line-through; font-weight: 600; }
.p-steps .step > svg { width: 18px; height: 18px; color: var(--p-text-3); }
.p-teaser { position: relative; overflow: hidden; display: grid; gap: 8px; padding: 16px; border-radius: 24px; background: var(--p-blue); color: #fff; cursor: pointer; isolation: isolate; }
.p-teaser::before { content: ""; position: absolute; right: -30px; top: -30px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255, 255, 255, .12); z-index: -1; }
.p-teaser::after { content: ""; position: absolute; right: 30px; bottom: -40px; width: 90px; height: 90px; border-radius: 50%; background: rgba(220, 251, 124, .25); z-index: -1; }
.p-teaser .emoji { font-size: 22px; }
.p-teaser .p-iconbtn { color: #fff; }
.p-teaser h3 { margin: 0; font-size: 18px; font-weight: 750; }
.p-teaser p { margin: 0; color: #E3E9FF; font-size: 14px; }
.p-teaser .go { display: inline-flex; align-items: center; gap: 6px; color: var(--p-lime); font-weight: 700; }
.p-teaser .go svg { width: 18px; height: 18px; }
.p-card.lav { background: var(--p-lav-soft); border-color: transparent; }
:root[data-theme="dark"] .p-card.lav, :root[data-theme="dark"] .p-card.lav * { color: #12173A; }
:root[data-theme="dark"] .p-card.lav { background: #DDE1FD; }
.p-learn { display: grid; gap: 8px; }
.p-learn .p-btn { justify-self: start; }
.p-coachrow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--p-text); cursor: pointer; }
.p-coachrow .p-grow { display: grid; min-width: 0; }
.p-coachrow > svg { width: 20px; height: 20px; color: var(--p-text-2); flex: none; }
.p-clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-month-nav { gap: 8px; align-items: center; }
.p-summary-hero { position: relative; overflow: hidden; display: grid; gap: 6px; padding: 20px; border-radius: 30px; background: var(--p-blue); color: #fff; isolation: isolate; }
.p-summary-hero::before { content: ""; position: absolute; right: -40px; top: -40px; width: 170px; height: 170px; border-radius: 50%; background: rgba(220, 251, 124, .22); z-index: -1; }
.p-summary-hero::after { content: ""; position: absolute; left: -30px; bottom: -50px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255, 255, 255, .10); z-index: -1; }
.p-summary-hero small { font-size: 12px; font-weight: 800; letter-spacing: .13em; color: var(--p-lime); }
.p-summary-hero h2 { margin: 0; font-size: 26px; font-weight: 800; }
.p-summary-hero .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 4%; }
.p-summary-hero .big { display: grid; gap: 2px; padding: 12px 0; }
.p-summary-hero .big b { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.p-summary-hero .big span { font-size: 13px; color: rgba(255, 255, 255, .82); }
/* заголовки на синих карточках — белые в обеих темах (общее правило заголовков их не перекрашивает) */
.p-page .p-teaser h3, .p-page .p-summary-hero h2 { color: #fff; }
/* текст строк — по токену type.b (15/600), как T v="b" в приложении */
.p-mini b, .p-steps .step b, .p-coachrow b { font-size: 15px; font-weight: 600; line-height: 1.4; }
.p-steps .step .p-cap { font-size: 12px; }

/* Browser glass fallback; native iOS uses expo-glass-effect. */
@media (max-width: 860px) {
  @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .shell .rail {
      background: color-mix(in srgb, var(--p-card) 82%, transparent);
      -webkit-backdrop-filter: blur(22px) saturate(160%);
      backdrop-filter: blur(22px) saturate(160%);
      border-radius: 999px;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 10px 34px rgba(0,0,0,.12);
    }
  }
  .shell .rail .nav-link { transition: transform 220ms ease, opacity 220ms ease; }
  .shell .rail .nav-link:active { transform: scale(.96); }
  .shell .rail .nav-link:focus-visible { outline: 3px solid var(--p-text); outline-offset: 2px; }
  body:has(input:focus, textarea:focus, [contenteditable="true"]:focus) .shell .rail { visibility: hidden; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) { .shell .rail .nav-link { transition: none; transform: none; } }
@media (prefers-reduced-transparency: reduce) {
  .shell .rail { background: var(--p-card); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Today-aligned schedule. Geometry and calendar interactions stay in their views. */
.fc-schedule { display: grid; gap: 20px; color: var(--p-text); }
.fc-schedule-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; }
.fc-schedule-title { margin: 0; min-width: 0; font-size: var(--fc-title-size, 37px); font-weight: 800; line-height: 1.08; letter-spacing: -.03em; }
.fc-schedule-header > .p-iconbtn { flex: none; }
.fc-schedule .fc-schedule-month { padding: 8px 0 12px; background: transparent; color: var(--p-text); border: 0; border-radius: 0; box-shadow: none; }
.fc-schedule-panel { display: grid; gap: 10px; padding: 10px 0; background: transparent; border: 0; box-shadow: none; }
.fc-schedule-panel .p-card-head { margin: 0; }
.fc-schedule-panel h3 { margin: 0; font-size: 17px; font-weight: 600; }
.fc-schedule-slots { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fc-schedule .p-slot { min-height: 44px; border-radius: 12px; font-size: 15px; font-weight: 600; box-shadow: none; }
.fc-schedule-day-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; }
.fc-schedule-day-head h2 { margin: 0; font-size: 18px; font-weight: 700; line-height: 24px; }
.fc-schedule-list { display: grid; gap: 0; }
.fc-schedule-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px; align-items: center; gap: 10px; width: 100%; min-height: 86px; padding: 14px 0; border: 0; border-bottom: 1px solid var(--p-line); border-radius: 0; background: transparent; color: var(--p-text); text-align: left; font: inherit; cursor: pointer; }
.fc-schedule-row.now { background: color-mix(in srgb, var(--p-lime) 10%, transparent); }
.fc-schedule-row:active, .fc-schedule-group-row:active { opacity: .72; }
.fc-schedule-row:focus-visible, .fc-schedule-group-row:focus-visible { outline: 2px solid var(--p-text); outline-offset: 3px; }
.fc-schedule-time { display: grid; align-content: center; justify-items: end; text-align: right; gap: 4px; white-space: nowrap; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 20px; }
.fc-schedule-time small { color: var(--p-text-2); font-size: 14px; font-weight: 500; }
.fc-schedule-event { display: grid; grid-template-columns: 40px minmax(0, 1fr) 24px; align-items: center; gap: 10px; min-width: 0; }
.fc-schedule-event .p-ava, .fc-schedule-event > .ico { width: 40px; height: 40px; min-width: 40px; border-radius: 50%; }
.fc-schedule-event > .ico { display: grid; place-items: center; background: var(--p-raised); color: var(--p-text-2); }
.fc-schedule-event > .ico svg { width: 21px; height: 21px; }
.fc-schedule-content { display: grid; gap: 3px; min-width: 0; }
.fc-schedule-content b, .fc-schedule-group-row .title { font-size: 17px; font-weight: 600; line-height: 23px; }
.fc-schedule-meta, .fc-schedule-group-row .meta { display: block; color: var(--p-text-2); font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.fc-schedule-more { color: var(--p-text-2); display: grid; place-items: center; }
.fc-schedule-more svg { width: 20px; height: 20px; }
.fc-schedule-group-row { display: grid; grid-template-columns: minmax(0, 1fr) 20px 64px; align-items: center; gap: 12px; width: 100%; padding: 14px 0; border: 0; border-bottom: 1px solid var(--p-line); border-radius: 0; background: transparent; color: var(--p-text); text-align: left; font: inherit; cursor: pointer; }
.fc-schedule-empty { margin: 0; padding: 18px 0; color: var(--p-text-2); font-size: 17px; }
@media (prefers-reduced-motion: reduce) { .fc-schedule-row, .fc-schedule .p-slot { transition: none; transform: none; } }

.p-refcard .end{align-content:end;align-self:end;display:flex;align-items:center;justify-content:flex-end;gap:4px}.p-refcard .end>svg{display:none}

/* Дневник питания спортсмена и выбранного подопечного. */
.fc-food-diary, .fc-meal-detail { --nutrition-kcal: var(--p-text); }
:root[data-theme="dark"] :is(.fc-food-diary, .fc-meal-detail) { --nutrition-kcal: var(--p-lime); }
.fc-food-summary { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fc-food-summary > svg { width: 118px; height: 118px; flex: none; }
.fc-food-numbers { flex: 1 1 145px; display: grid; gap: 5px; font-size: 13px; font-variant-numeric: tabular-nums; }
.fc-food-numbers strong { font-size: 32px; line-height: 1.25; }
.fc-food-over { color: var(--p-warn); }
.fc-food-macro { display: flex; align-items: center; gap: 6px; }
.fc-food-macro i { width: 10px; height: 10px; border-radius: 50%; }
.fc-food-macro b { margin-inline-start: auto; }
.fc-food-meal { display: grid; gap: 7px; padding: 10px 12px; }
.fc-food-open, .fc-food-detail { font: inherit; text-align: start; color: inherit; border: 0; background: transparent; cursor: pointer; }
.fc-food-open { display: flex; flex: 1; min-width: 0; align-items: center; gap: 10px; min-height: 48px; padding: 0; }
.fc-food-open .p-food-ph { flex: none; width: 42px; height: 42px; border-radius: 14px; color: var(--p-text); background: #FFF2D7; }
.fc-food-open .p-food-ph[data-m="lunch"] { background: #EEFCC6; }
.fc-food-open .p-food-ph[data-m="snack"] { background: #E9E4FF; }
.fc-food-open .p-food-ph[data-m="dinner"] { background: #DDEFFA; }
:root[data-theme="dark"] .fc-food-open .p-food-ph { background: #3A3424; }
:root[data-theme="dark"] .fc-food-open .p-food-ph[data-m="lunch"] { background: #2F3A1E; }
:root[data-theme="dark"] .fc-food-open .p-food-ph[data-m="snack"] { background: #2E2A4E; }
:root[data-theme="dark"] .fc-food-open .p-food-ph[data-m="dinner"] { background: #203247; }
.fc-food-open .p-food-ph svg { width: 21px; height: 21px; }
.fc-food-open small { display: block; font-size: 12px; color: var(--p-text-2); }
.fc-food-kcal { text-align: end; }
.fc-food-detail { margin-inline-start: 52px; padding: 0; white-space: pre-line; overflow-wrap: anywhere; }
.fc-food-note { background: var(--p-lav-soft); color: #12173A; border-radius: 14px; padding: 9px; }
.fc-nutrition-date .p-dstrip { gap: 4px; }
.fc-nutrition-date > .p-row { display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:4px; }
.fc-nutrition-date > .p-row > .p-btn { min-width:0;max-width:100%;min-height:44px;padding:0 4px;gap:8px;border:0;background:transparent;font-size:15px;font-weight:800;line-height:1.3;white-space:normal;overflow-wrap:anywhere; }
.fc-nutrition-date > .p-row > .p-btn small { font-size:13px;font-weight:600;color:var(--p-text-2); }
.fc-nutrition-date > .p-row > .p-btn svg { flex:none;width:16px;height:16px;color:var(--p-blue-text); }
.fc-nutrition-date .p-dstrip button { min-height: 54px; border-radius: 16px; }
:root[data-theme="light"] .fc-nutrition-date .p-dstrip button[aria-pressed="true"] { background: #12173A; color: #fff; }
:root[data-theme="light"] .fc-nutrition-date .p-dstrip button[aria-pressed="true"] small { color: #C8CDE3; }
.fc-nutrition-date .p-dstrip button i { background: var(--p-lime-2); }
@media (max-width: 364px) {
  .fc-food-summary > svg { width: 96px; height: 96px; }
}

/* Strength reference tile and the chart shared with exercise history. */
.p-card.fc-strength-tile {
  background: #12173a;
  color: #fff;
  --strength-ink: #dcfb7c;
  --strength-track: #505574;
}
.fc-strength-open { display: grid; gap: .375rem; color: inherit; text-decoration: none; }
.fc-strength-open small { color: #d1d4e5; }
.fc-strength-open strong, .fc-strength-record strong { font-size: 1.65rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.fc-strength-chart { color: inherit; }
.fc-strength-scrub { cursor: crosshair; touch-action: manipulation; }
.fc-strength-scrub svg { display: block; width: 100%; }
.fc-strength-scrub line { stroke: var(--strength-track, var(--p-line)); stroke-width: .8; }
.fc-strength-scrub text { fill: currentColor; font-size: 10px; }
.fc-strength-scrub circle { fill: var(--strength-ink, var(--p-blue-text)); }
.fc-strength-scrub .fc-strength-trend { stroke: var(--strength-ink, var(--p-blue-text)); stroke-width: 2; fill: none; }
.fc-strength-scrub .fc-strength-area { fill: var(--strength-ink, var(--p-blue-text)); opacity: .09; }
.fc-strength-reading { display: block; border-top: 1px solid var(--strength-track, var(--p-line)); font-variant-numeric: tabular-nums; padding-top: 4px; }
.p-card.fc-strength-record { background: #dcfb7c; color: #12173a; }
.fc-strength-record small { display: block; }

.fc-pro-trainer-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  width: fit-content;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  color: #5948c9;
  background-color: #eceeff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1px;
  line-height: 1.2;
}
:root[data-theme="dark"] .fc-pro-trainer-badge { color: #4a3ba8; background-color: #c4c8ff; }

.p-conv.fc-conv-split.fc-conv-menu-row { grid-template-columns: auto minmax(0,1fr) auto; }

.fc-progress-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.fc-progress-pair>*{min-width:0}
.fc-progress-photo,.fc-progress-measures{color:inherit;text-align:start;font:inherit;cursor:pointer}
.fc-progress-photo-preview{display:grid;gap:6px;min-height:64px;align-content:center}
.fc-progress-photo-preview img{display:block;width:100%;max-height:240px;object-fit:cover;border-radius:10px}
.fc-progress-photo-frame {
  height: clamp(150px, 50dvh, 560px);
  touch-action: pan-y pinch-zoom;
  user-select: none;
}
.fc-progress-photo-frame img { width: 100%; height: 100%; max-height: 100%; }
.fc-progress-photo-error { padding: 12px; text-align: center; }
.fc-progress-photo-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}
.fc-progress-photo-controls .icon-btn { flex: 0 0 44px; height: 44px; }
.fc-progress-photo-controls .icon-btn[aria-disabled="true"] { opacity: .45; }
.fc-progress-measures{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.fc-progress-measures small,.fc-progress-measures b,.p-hist .p-cap{display:block}
@media(max-width:350px){.fc-progress-pair{grid-template-columns:1fr}}

.fc-progress-inbody{display:grid;align-content:space-between;gap:8px;color:inherit;text-decoration:none}
.fc-progress-inbody img{width:100%;height:150px;object-fit:contain}
.fc-progress-inbody .p-row{flex-wrap:wrap}
/* Reference palette of the native Progress weight tile. */
body[data-route="progress"] .p-weight{
  --p-card:#12173a;--p-text:#fff;--p-text-2:#a8b1cc;--p-line:rgba(255,255,255,.18);
  background:var(--p-card);color:var(--p-text)
}
:root[data-theme="dark"] body[data-route="progress"] .p-weight{--p-card:#2b3765}
body[data-route="progress"] .p-weight .p-card-head h3,body[data-route="progress"] .p-weight .p-weight-big{color:#fff}
body[data-route="progress"] .p-weight .p-seg{background:rgba(255,255,255,.10)}
body[data-route="progress"] .p-weight .p-seg button:not([aria-pressed="true"]){color:#fff}
body[data-route="progress"] .p-weight .p-delta{background:var(--p-lime);color:#12173a}
body[data-route="progress"] .p-weight .p-delta.muted{padding-inline:0;background:transparent;color:#a8b1cc}
body[data-route="progress"] .p-weight .p-chart .lbl{fill:#a8b1cc}

/* Progress tiles share the compact hierarchy used by the iOS overview. */
.fc-progress-pair { align-items:start; }
.fc-progress-pair > [style="display: contents;"] { align-self:start; }
.fc-progress-inbody { align-content:start; min-height:260px; }
.fc-progress-inbody img { height:180px; margin:auto; }
.fc-progress-inbody > small { font-size:13px; line-height:1.5; }
.fc-progress-steps { gap:10px; padding:16px; }
.fc-progress-steps .p-card-head { gap:6px; margin:0; }
.fc-progress-steps .p-card-head h3 { font-size:13px; }
.fc-progress-steps .p-card-head .p-btn { min-width:36px; min-height:36px; padding:6px; }
.fc-progress-steps .p-card-head .p-btn span { display:none; }
.fc-progress-steps > .p-qtile { order:3; padding:8px 0; border:0; box-shadow:none; border-radius:0; min-height:44px; font-size:13px; gap:6px; }
.fc-progress-steps > .p-qtile > svg { width:16px; height:16px; }
.fc-progress-steps > .p-stack > .p-stack { grid-template-columns:52px minmax(0,1fr); align-items:center; gap:10px; }
.fc-progress-steps .p-ring { width:52px!important; height:52px!important; }
.fc-progress-steps .p-ring svg { width:52px; height:52px; }
.fc-progress-steps .p-ring .ctr { display:none; }
.fc-progress-steps .fc-steps-extra { display:none!important; }
.fc-steps-compact-facts { display:grid; gap:3px; min-width:0; }
.fc-steps-compact-facts b { font-size:20px; font-variant-numeric:tabular-nums; }
.fc-steps-compact-facts span,.fc-steps-compact-facts small { font-size:11px; color:var(--p-text-2); overflow-wrap:anywhere; }
.fc-progress-pair .p-reg-top { display:grid; grid-template-columns:auto minmax(0,1fr); gap:8px; margin-bottom:8px; }
.fc-progress-pair .p-reg-m { display:none; }
.fc-progress-pair .p-reg-num { font-size:32px; }
.fc-progress-pair .p-reg-t { font-size:13px; }
.fc-progress-pair .p-reg-top .p-cap,.fc-progress-pair .p-legend { font-size:11px; line-height:1.4; }
.fc-progress-pair button.p-card { text-align:start; }
.p-hist .d { align-content:center; }
.p-hist .d small { white-space:nowrap; }
.p-hist > .p-grow { min-width:0; }
.p-hist > .p-grow > b { display:block; line-height:1.35; }
.p-hist > .p-grow > small { font-size:13px; line-height:1.45; margin-top:4px; }
@media (max-width:600px) {
  .p-hist { grid-template-columns:56px minmax(0,1fr); gap:4px 12px; }
  .p-hist .d { grid-row:1 / 3; min-height:58px; }
  .p-hist > .p-cap { grid-column:2; font-size:12px; }
  .fc-progress-pair > .p-stack > button.p-card { padding:14px; }
}

.fc-progress-inbody.is-empty { align-content:space-between; min-height:260px; background:var(--p-lime); color:#12173a; }
.fc-progress-inbody.is-empty > svg { width:48px; height:48px; justify-self:center; margin:24px 0; }
.fc-progress-inbody.is-empty > small { color:#3e4f0e; font-weight:650; }
.fc-progress-regularity { display:grid; gap:12px; }
.fc-progress-regularity .p-card-head { gap:4px; margin:0; flex-wrap:wrap; }
.fc-progress-regularity .p-card-head h3 { font-size:13px; }
.fc-progress-regularity .p-card-head > b { font-size:13px; margin-left:auto; }
.fc-progress-regularity .p-heat { gap:4px; }

@media (min-width:1000px) {
  .fc-progress-regularity .p-heat i { aspect-ratio:auto; height:12px; border-radius:5px; }
}

/* Nutrition tiles retain the native surfaces in both athlete and coach views. */
.fc-food-overview { background:var(--p-card); border:1px solid var(--p-line); border-radius:24px; padding:14px; gap:12px; min-width:0; }
.fc-food-meals { display:grid; gap:12px; min-width:0; }
.fc-food-meal { background:var(--p-card); border:1px solid var(--p-line); border-radius:24px; padding:10px 10px 10px 12px; min-width:0; overflow:hidden; }
.fc-food-meal > .p-row { gap:10px; }
.fc-food-meal .p-grow { min-width:0; }
.fc-food-open .p-grow > b { font-size:15px; font-weight:800; }
.fc-food-open .p-grow > small { font-weight:600; }
.fc-food-kcal > b { font-size:15px; font-weight:800; }
.fc-food-kcal > small { font-size:11px; font-weight:700; }
.fc-food-meal .p-iconbtn { width:44px; height:44px; flex:none; }
.fc-food-overview .fc-food-numbers { font-size:12px; font-weight:700; }
.fc-food-overview .fc-food-numbers strong { font-size:32px; font-weight:800; }
.fc-food-meal .fc-food-detail { font-size:12px; font-weight:600; line-height:1.4; }

.fc-food-overview .fc-food-numbers { flex:1; min-width:0; }
@media(min-width:305px) { .fc-food-overview .fc-food-summary { flex-wrap:nowrap; } }

.fc-food-detail:has(> svg) { display:flex; align-items:center; gap:5px; min-height:32px; }
.fc-food-detail > svg { width:15px; height:15px; flex:none; }
.fc-meal-total-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(90px,1fr)); gap:16px; }
.fc-meal-total-grid > div { min-width:0; }
.fc-meal-detail [data-meal-macro="kcal"] { --meal-macro: var(--nutrition-kcal); }
.fc-meal-detail [data-meal-macro="protein"] { --meal-macro: var(--p-protein); }
.fc-meal-detail [data-meal-macro="fat"] { --meal-macro: var(--p-fat); }
.fc-meal-detail [data-meal-macro="carbs"] { --meal-macro: var(--p-carbs); }
.fc-meal-macros { display:flex; flex-wrap:wrap; align-items:center; gap:4px; }
.fc-meal-macro { padding:1px 5px; border-radius:5px; background:var(--meal-macro); color:var(--p-out-ink); white-space:nowrap; }
.fc-meal-macro-label { display:flex; align-items:center; gap:6px; }
.fc-meal-macro-label > i { flex:none; width:8px; height:8px; border-radius:50%; background:var(--meal-macro); }
.fc-meal-detail .fc-meal-kcal { color:var(--nutrition-kcal); }

.fc-meeting-selection,.fc-meeting-selection-stage { display:grid;gap:16px;min-width:0; }
.fc-meeting-selection-stage[hidden],.fc-meeting-search[hidden] { display:none; }
.fc-meeting-person { display:flex;align-items:center;gap:12px;min-height:60px;width:100%;text-align:left;padding:8px 12px;border:1px solid var(--p-line);border-radius:16px;background:var(--p-card);color:var(--p-text);font:inherit;cursor:pointer; }
.fc-meeting-person b { flex:1;min-width:0;overflow-wrap:anywhere; }
.fc-meeting-person>svg { width:18px;flex:none; }
.fc-meeting-roster { display:grid;gap:8px;max-height:360px;overflow-y:auto; }
.fc-meeting-search { padding-bottom:8px; }
.fc-meeting-time-row { display:flex;align-items:center;gap:12px;border:1px solid var(--p-line);border-radius:16px;padding:4px 12px;min-height:50px; }
.fc-meeting-time-row>b { flex:1; }
.fc-meeting-time-row>.p-select { width:128px;min-width:0;flex:none;border:0;font-variant-numeric:tabular-nums; }
.fc-meeting-busy>summary { color:var(--p-text-2);cursor:pointer;padding:8px 0; }
.fc-meeting-busy-card { border:1px solid var(--p-line);border-radius:14px;padding:8px 10px; }
.fc-meeting-busy-card>summary { display:flex;align-items:center;gap:10px;list-style:none;cursor:pointer; }
.fc-meeting-busy-card>summary::-webkit-details-marker { display:none; }
.fc-meeting-busy-card>summary>span { display:grid;flex:1; }
.fc-meeting-busy-card>summary>span>span { color:var(--p-text-2);font-size:14px; }
.fc-meeting-busy-card>summary>svg { width:16px;flex:none; }
.fc-meeting-selection-stage { animation:fc-meeting-enter .18s ease-out; }
@keyframes fc-meeting-enter { from { opacity:0;transform:translateY(8px); } to { opacity:1;transform:translateY(0); } }
@media(prefers-reduced-motion:reduce) { .fc-meeting-selection-stage { animation:none; } }
.fc-meeting-time-trigger { display:flex;align-items:center;justify-content:space-between;gap:16px;width:112px;min-height:44px;border:0;border-radius:8px;background:transparent;color:var(--p-text);font:inherit;font-weight:600;font-variant-numeric:tabular-nums;cursor:pointer; }
.fc-meeting-time-trigger svg { width:16px;flex:none; }
.fc-meeting-time-options { position:relative;margin:6px 0 0;width:100%;max-height:220px;overflow-y:auto;overscroll-behavior:contain;border:1px solid var(--p-line);border-radius:14px;padding:4px;box-sizing:border-box;background:var(--p-card);box-shadow:0 6px 20px rgba(20,25,54,.08); }
.fc-meeting-time-options[hidden] { display:none; }
.fc-meeting-time-state { padding:12px;color:var(--p-text-2);font-size:14px; }
.fc-meeting-time-state p { margin:0 0 6px; }
.fc-meeting-time-options>[role=option] { display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:42px;width:100%;padding:8px 12px;border:0;border-radius:10px;text-align:left;background:transparent;color:var(--p-text);font:inherit;font-weight:600;font-variant-numeric:tabular-nums;cursor:pointer; }
.fc-meeting-time-options>[aria-selected=true] { background:var(--p-lime);color:var(--p-lime-ink); }
.fc-meeting-time-options>[role=option]:hover { box-shadow:inset 0 0 0 1px var(--p-line); }
.fc-meeting-time-occupied { display:flex;align-items:center;gap:10px;padding:10px 8px;margin:4px 0;width:100%;border:1px solid transparent;border-radius:10px;text-align:left;font:inherit;cursor:pointer;background:var(--p-raised);color:var(--p-text); }
.fc-meeting-time-occupied:has([role=alert]:not([hidden])) { border-color:var(--p-warn); }
.fc-meeting-time-occupied [role=alert] { color:var(--p-warn);font-weight:600; }
.fc-meeting-time-occupied>span { display:grid;gap:2px;min-width:0;flex:1;overflow-wrap:anywhere; }
.fc-meeting-time-occupied b { font-size:14px;font-variant-numeric:tabular-nums; }
.fc-meeting-time-occupied span>span { font-size:12px;color:var(--p-text-2); }
.fc-meeting-time-occupied small { font-size:11px;color:var(--p-text-2); }
.fc-meeting-time-occupied>svg { width:24px;flex:none; }

/* Approved chat event, concept 4: actor + action, separate date, subtle lime glass. */
.fc-chat-booking-glass{display:flex;align-items:center;gap:10px;width:100%;min-height:78px;padding:12px;border:1px solid rgba(174,209,74,.24);border-radius:20px;background:rgba(247,252,232,.82);backdrop-filter:blur(14px) saturate(1.1);-webkit-backdrop-filter:blur(14px) saturate(1.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.5);color:var(--p-text);font:inherit;text-align:left;cursor:pointer;transition:background-color 160ms ease,opacity 160ms ease}
.fc-chat-booking-glass>.p-ava{width:36px;height:36px;flex:none;font-size:13px}
.fc-chat-booking-glass>svg{width:15px;height:15px;flex:none;color:var(--p-text-2)}
.fc-chat-booking-person{display:flex;flex-direction:column;gap:3px;flex:1;min-width:0;overflow-wrap:anywhere}
.fc-chat-booking-person strong{font-size:14px;line-height:19px;font-weight:700}
.fc-chat-booking-person>span{font-size:13px;line-height:18px;color:var(--p-text-2)}
.fc-chat-booking-date{display:flex;flex-direction:column;gap:3px;flex:none;max-width:34%;padding-left:10px;border-left:2px solid var(--p-lime);font-variant-numeric:tabular-nums}
.fc-chat-booking-date strong{font-size:13px;line-height:18px;font-weight:600}
.fc-chat-booking-date>span{font-size:15px;line-height:20px}
[data-theme=dark] .fc-chat-booking-glass{background:rgba(54,65,36,.78);border-color:rgba(219,255,119,.22);box-shadow:inset 0 1px 0 rgba(255,255,255,.08)}
@media(hover:hover){.fc-chat-booking-glass:hover{background:rgba(239,249,211,.94)}}
@media(prefers-reduced-motion:reduce){.fc-chat-booking-glass{transition:none}}

/* Existing rows stay still when read receipts, pins or reactions reconcile. */
.p-msg.arriving,.p-refcard.arriving{animation:p-msg-in .22s cubic-bezier(.2,.8,.2,1)}
@media(prefers-reduced-motion:reduce){.p-msg.arriving,.p-refcard.arriving{animation:none}}
