/* Приложение клиента SorokinFit (этап 5, 14.10). Цвета и размеры из общего app.css (токены CRM), каркас свой: телефон, одна рука, большие кнопки. */
/* 16.10: общий app.css портала команды ставит body { height: 100%; overflow: hidden } (там прокручиваются колонки), у клиента прокручивается
   вся страница: без этой строки на телефоне пальцем страницу не сдвинуть (Миша 16.10: «портал клиента на телефоне не крутится») */
html, body { height: auto; overflow: visible; overflow-x: hidden; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, sans-serif; -webkit-text-size-adjust: 100%; }
.ca { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.ca-main { flex: 1; padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); }
.ca-h1 { font-size: 22px; font-weight: 750; margin: 6px 0 2px; letter-spacing: -.2px; }
.ca-sub { color: var(--text-3); font-size: 13px; margin-bottom: 14px; }
.ca-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin: 10px 0; }
.ca-card.is-dark { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.ca-card.is-dark .ca-bar { background: rgba(127,127,127,.35); }
.ca-card.is-dark .ca-m { color: inherit; opacity: .72; }
.ca-t { font-weight: 700; font-size: 16px; margin: 0 0 4px; }
.ca-m { color: var(--text-3); font-size: 13px; }
.ca-row { display: flex; align-items: center; gap: 10px; }
.ca-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 650; font-size: 15px; cursor: pointer; text-decoration: none; }
.ca-btn.is-primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.ca-btn.is-block { width: 100%; }
.ca-btn.is-sm { min-height: 40px; font-size: 14px; padding: 0 14px; }
.ca-btn:disabled { opacity: .5; }
.ca-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ca-input { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 16px; padding: 0 12px; box-sizing: border-box; }
.ca-nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.ca-nav-in { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; max-width: 560px; }
.ca-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px 8px; color: var(--text-3); text-decoration: none; font-size: 11px; font-weight: 600; }
.ca-nav a.is-on { color: var(--text); }
.ca-nav svg { width: 22px; height: 22px; }
.ca-ring { position: relative; width: 132px; height: 132px; margin: 6px auto; }
.ca-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ca-ring .bg { stroke: var(--surface-3, #e5e7eb); }
.ca-ring .fg { stroke: var(--blue); transition: stroke-dashoffset .4s; }
.ca-ring-v { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 750; font-size: 20px; }
.ca-ring-v small { font-weight: 500; font-size: 12px; color: var(--text-3); }
.ca-ex { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ca-ex:last-child { border-bottom: 0; }
.ca-ex-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ca-ex-n { font-weight: 650; }
.ca-ex-s { color: var(--text-3); font-size: 13px; }
.ca-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.ca-set { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ca-set input { min-height: 40px; font-size: 15px; text-align: center; padding: 0 4px; }
.ca-chk { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; }
.ca-chk input { width: 22px; height: 22px; }
.ca-meal { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ca-meal:last-child { border-bottom: 0; }
.ca-meal-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 650; }
.ca-meal ul { margin: 4px 0 8px; padding-left: 18px; font-size: 14px; }
.ca-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.ca-seg button { min-height: 36px; padding: 0 12px; border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; }
.ca-seg button.is-on { background: var(--ink); color: var(--on-ink); }
.ca-list { display: flex; flex-direction: column; }
.ca-li { display: flex; justify-content: space-between; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ca-li:last-child { border-bottom: 0; }
.ca-note { background: var(--amber-soft); color: var(--amber-text); border-radius: 12px; padding: 10px 12px; font-size: 13px; margin: 10px 0; }
.ca-ok { background: var(--green-soft); color: var(--green-text); border-radius: 12px; padding: 10px 12px; font-size: 13px; margin: 10px 0; }
.ca-toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--on-ink); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 50; }
.ca-center { text-align: center; padding: 40px 16px; }
.ca-logo { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 12px; display: block; }
.ca-pre { white-space: pre-wrap; font-size: 13px; color: var(--text-2); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.ca-chart { display: block; width: 100%; height: 60px; color: var(--blue); }

/* 14.10, недельный портал: неделя, ЕИГ, подходы с весом, таймер отдыха, видео, графики, тема */
.ca-bar { height: 8px; border-radius: 999px; background: rgba(127,127,127,.25); overflow: hidden; margin: 8px 0; }
.ca-bar-in { height: 100%; background: var(--blue); border-radius: 999px; transition: width .4s; }
.ca-phrase { font-size: 14px; margin: 6px 0 2px; line-height: 1.4; }
.ca-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.ca-day { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(127,127,127,.35); background: rgba(127,127,127,.16); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ca-day.is-done { background: rgba(80,200,120,.25); border-color: rgba(80,200,120,.6); }
.ca-day svg { width: 16px; height: 16px; }
.ca-day-t { font-weight: 650; font-size: 14px; }
.ca-day-m { font-size: 12px; opacity: .75; }
.ca-eig-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ca-eig-row:last-of-type { border-bottom: 0; }
.ca-eig-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.ca-eig-v { font-weight: 750; font-size: 20px; }
.ca-range { width: 100%; margin: 8px 0 4px; accent-color: var(--blue); height: 32px; }
.ca-eig-scale { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 11px; color: var(--text-3); }
.ca-eig-scale span:nth-child(2) { text-align: center; }
.ca-eig-scale span:nth-child(3) { text-align: right; }
.ca-eig-res { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.ca-eig-badge { display: inline-block; align-self: flex-start; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; background: var(--surface-2); }
.ca-eig-badge.is-rest { background: #fde2e2; color: #8a1f1f; }
.ca-eig-badge.is-light { background: #fff1d6; color: #7a4b00; }
.ca-eig-badge.is-medium { background: #e3f0ff; color: #1b4a8a; }
.ca-eig-badge.is-heavy { background: #dcf5e4; color: #1d5c34; }
.ca-eig-badge.is-intense { background: #e9ddff; color: #4b2a8a; }
.ca-video { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #000; margin-bottom: 8px; }
.ca-video.is-file { aspect-ratio: auto; max-height: 70vh; object-fit: contain; }   /* снято на телефон: часто вертикальное */
.ca-sets-h, .ca-set { display: grid; grid-template-columns: 28px 1fr 1fr 48px; gap: 6px; align-items: center; }
.ca-sets-h { font-size: 11px; color: var(--text-3); padding: 0 2px; }
.ca-sets { display: flex; flex-direction: column; gap: 6px; }
.ca-set-n { font-size: 13px; color: var(--text-3); text-align: center; }
.ca-set input { min-height: 44px; font-size: 16px; text-align: center; padding: 0 6px; }
.ca-chkb { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ca-chkb svg { width: 20px; height: 20px; }
.ca-chkb.is-on { background: var(--green, #2e9e5b); border-color: var(--green, #2e9e5b); color: #fff; }
.ca-timer { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(92vw, 520px); display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; background: var(--ink); color: var(--on-ink); padding: 10px 14px; border-radius: 14px; z-index: 40; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.ca-timer.is-done { background: var(--green, #2e9e5b); }
.ca-timer-t { font-size: 13px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-timer-v { font-weight: 750; font-size: 22px; font-variant-numeric: tabular-nums; }
.ca-timer .ca-btn { background: rgba(255,255,255,.15); border-color: transparent; color: inherit; }
.ca-seg-days { display: flex; flex-wrap: wrap; margin-bottom: 10px; }
.ca-seg-days button { flex: 1; min-height: 40px; }
.ca-wd { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 10px; }
.ca-wd span { text-align: center; padding: 8px 0; border-radius: 10px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--text-2); }
.ca-wd span.is-tr { background: var(--blue-soft, #dbe7ff); color: var(--blue-text, #1b4a8a); }
.ca-wd span.is-cur { outline: 2px solid var(--ink); }
.ca-details summary { font-weight: 700; cursor: pointer; }
.ca-shop ul { margin: 4px 0 10px; padding-left: 18px; font-size: 14px; }
.ca-shop .ca-t { font-size: 14px; margin-top: 8px; }
.ca-chart { display: block; width: 100%; height: 90px; color: var(--text); }
.ca-bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; align-items: end; height: 90px; margin-top: 8px; }
.ca-bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; }
.ca-bar-v { width: 70%; min-height: 2px; border-radius: 4px 4px 0 0; }
.ca-bar-l { font-size: 10px; color: var(--text-3); }
.ca-seg button svg { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
@media (min-width: 720px) { .ca { max-width: 720px; } .ca-nav-in { max-width: 720px; } .ca-days { grid-template-columns: repeat(3, 1fr); } }
.ca-preview { position: sticky; top: 0; z-index: 30; background: var(--amber-soft); color: var(--amber-text); font-size: 13px; font-weight: 600; text-align: center; padding: 8px 12px; }
.ca-frames { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.ca-frames img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 12px; background: #fff; }
.ca-frames-src { position: absolute; right: 6px; bottom: 6px; font-size: 10px; color: #fff; background: rgba(0,0,0,.45); padding: 2px 6px; border-radius: 6px; }

/* анкета ведения (15.10) */
.ca-iq { padding: 18px 16px; }
.ca-iq-q { font-size: 19px; font-weight: 700; line-height: 1.3; margin: 4px 0 10px; }
.ca-iq-opt-l { font-size: 13px; font-weight: 500; color: var(--text-3); }
.ca-iq-long { min-height: 120px; padding: 10px 12px; line-height: 1.45; resize: vertical; }
.ca-iq-opts { display: grid; gap: 8px; }
.ca-iq-opt { min-height: 52px; padding: 10px 14px; text-align: left; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.ca-iq-opt.is-on, .ca-iq-pt.is-on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.ca-iq-scale { display: grid; grid-template-columns: repeat(auto-fit, minmax(40px, 1fr)); gap: 6px; }
.ca-iq-pt { min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; font-weight: 650; cursor: pointer; }
.ca-iq-caps { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--text-3); }
.ca-iq-err { margin-top: 8px; color: var(--red-text, #b42318); font-size: 14px; font-weight: 600; }
.ca-iq-nav { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 6px; }
.ca-iq-nav > :only-child { grid-column: 1 / -1; }
.ca-link { display: block; margin: 14px auto 0; background: none; border: 0; color: var(--text-3); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }
.ca-iq-banner { border-color: var(--ink); }
/* 16.10 (пункт 1.8): неделя по дням, правила, фото */
.ca-li.is-today { font-weight: 600; }
.ca-li b { text-align: right; max-width: 62%; overflow-wrap: anywhere; }
.ca-rules > summary { cursor: pointer; list-style: none; }
.ca-rules > summary::-webkit-details-marker { display: none; }
.ca-rules-t { white-space: pre-wrap; margin-top: 8px; line-height: 1.5; }
.ca-photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.ca-photo { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; background: var(--surface-2); display: block; }

/* 16.10 вечер: своё подтверждение «Да / Отмена» (ask в app.js) */
.ca-ask { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .45); }
.ca-ask-card { width: min(420px, 100%); margin: 0 0 calc(8px + env(safe-area-inset-bottom)); }
.ca-ask-card p { margin: 0 0 12px; font-size: 16px; }
.ca-ask-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ca-ask-in { width: 100%; min-height: 48px; margin: 0 0 12px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg, transparent); color: var(--text); font: inherit; font-size: 18px; box-sizing: border-box; }
