/* Фабрика Фитнеса — Mini App. Тёмная фирменная + светлая; переменные ставит app.js. */
:root {
  --pink: #D43977; --pink-bright: #FF4F9A; --pink-dim: #501D35; --pink-soft: #ff8fab;
  --bg: #0A080D; --card: #251824; --line: #5E3750; --line2: #3a2b3a;
  --text: #F9F8F9; --mut: #a893a0; --input: #150e14; --ok-bg: #1e3a24; --ok: #7ddf96;
  --warn-bg: #3d3015; --warn: #f0c85a; --frz-bg: #16303d; --frz: #6fc3e8;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font: 14px/1.45 "Segoe UI", Arial, sans-serif;
  color: var(--text); background: var(--bg); min-height: 100vh;
  padding-bottom: 76px;
}
button { font: inherit; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--text); padding: 9px 15px; cursor: pointer; }
button:hover { border-color: var(--pink); }
button.p { background: var(--pink); border-color: var(--pink); font-weight: 700; width: 100%; padding: 12px; font-size: 15px; }
button.p:hover { background: #B51F5A; }
button:disabled { opacity: .5; }
.btn { display: block; width: 100%; margin-top: 10px; }
.ghost { width: 100%; margin-top: 8px; color: var(--pink-bright); }
input, select { font: inherit; width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--input); color: var(--text); margin-bottom: 4px; }
input:focus, select:focus { outline: none; border-color: var(--pink); }
input.bad { border-color: #e04a4a; }
label { display: block; font-size: 13px; color: var(--mut); margin: 8px 0 4px; }
.err { color: #e04a4a; font-size: 12px; min-height: 16px; margin-bottom: 4px; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--mut); margin: 16px 2px 8px; }
.big { font-size: 17px; font-weight: 700; }
.mut { color: var(--mut); font-size: 12px; }
.pink { color: var(--pink-bright); }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; }
.empty { text-align: center; color: var(--mut); padding: 40px 16px; }

/* ── топбар: аватар + имя + уровень → профиль ── */
#head {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--bg); border-bottom: 1px solid var(--line2);
}
#head:empty { display: none; }
.h-ava { width: 42px; height: 42px; border-radius: 50%; background: var(--pink-dim); color: var(--pink-soft);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; overflow: hidden; flex: none; }
.h-ava img { width: 100%; height: 100%; object-fit: cover; }
.h-name { font-weight: 700; cursor: pointer; }
.h-sub { font-size: 11px; color: var(--mut); cursor: pointer; }

/* ── табы ── */
#tabs {
  position: fixed; bottom: 0; left: 0; right: 0; height: 62px;
  display: flex; background: var(--input); border-top: 1px solid var(--line2); z-index: 5;
}
#tabs:empty { display: none; }
#tabs .t { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 11px; color: var(--mut); border: none; background: none; padding: 0; border-radius: 0; }
#tabs .t .i { font-size: 20px; filter: grayscale(1) opacity(.6); }
#tabs .t.on { color: var(--pink-bright); font-weight: 600; }
#tabs .t.on .i { filter: none; }

#app { padding: 14px 14px 18px; max-width: 520px; margin: 0 auto; }

/* ── карточки и элементы ── */
.card { background: var(--card); border-radius: 14px; padding: 13px 15px; margin-bottom: 10px; border: 1px solid var(--line2); }
.card.act { border-color: var(--pink); }
.card.dim { opacity: .5; }
.banner { background: var(--warn-bg); border: 1px solid #6b5518; color: var(--warn); border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; }
.prog { height: 6px; background: var(--line2); border-radius: 3px; overflow: hidden; margin: 6px 0; }
.prog i { display: block; height: 100%; background: var(--pink); border-radius: 3px; }
.chip { font-size: 12px; padding: 4px 12px; border-radius: 12px; background: var(--line2); margin: 2px 4px 2px 0; }
.chip.on { background: var(--pink); border-color: var(--pink); }
.st { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.st.ok { background: var(--ok-bg); color: var(--ok); }
.st.wait { background: var(--warn-bg); color: var(--warn); }
.st.lock { background: var(--line2); color: var(--mut); }
.st.frz { background: var(--frz-bg); color: var(--frz); }
.opt { display: block; width: 100%; text-align: left; padding: 11px 14px; margin-bottom: 8px; }
.back { font-size: 13px; color: var(--pink-bright); border: none; padding: 0 0 8px; }
.back:hover { text-decoration: underline; }
.statn { text-align: center; padding: 14px; }
.statn .n { font-size: 34px; font-weight: 800; color: var(--pink-bright); }
.lvl { display: inline-block; padding: 6px 16px; border-radius: 20px; background: var(--pink); font-weight: 700; font-size: 15px; margin: 10px 0; }
.logo-img { width: 170px; border-radius: 14px; box-shadow: 0 8px 30px rgba(212,57,119,.35); }

/* недели / занятия / упражнения */
.week { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: var(--card); border-radius: 12px; margin-bottom: 8px; border: 1px solid var(--line2); cursor: pointer; }
.week.done { opacity: .65; }
.week.locked { opacity: .45; cursor: default; }
.week .dot { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: none; }
.week.done .dot { background: var(--ok-bg); color: var(--ok); }
.week.now .dot { background: var(--pink); color: #fff; }
.week.locked .dot { background: var(--line2); color: var(--mut); }
.exo { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: var(--card); border-radius: 12px; margin-bottom: 8px; border: 1px solid var(--line2); cursor: pointer; }
.exo .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--line2); display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none; }
.ex { cursor: default; }
.ex-head { cursor: pointer; }
.ex-body { display: none; margin-top: 10px; }
.ex.open .ex-body { display: block; }
.video { height: 190px; background: linear-gradient(135deg, var(--card), var(--line2)); border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; margin-bottom: 12px; border: 1px solid var(--line); overflow: hidden; color: var(--mut); font-size: 12px; }
.video iframe, .video video { width: 100%; height: 100%; border: none; }
.plan-box { background: var(--pink-dim); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; font-size: 13px; }
.plan-lbl { font-size: 10px; text-transform: uppercase; color: var(--pink-soft); letter-spacing: .6px; display: block; }
.tech { font-size: 13px; color: var(--mut); margin-bottom: 10px; }
table.sets { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
table.sets th { font-size: 11px; color: var(--mut); font-weight: 400; text-align: center; padding: 4px; }
table.sets td { padding: 3px 4px; text-align: center; }
table.sets td input { text-align: center; margin: 0; padding: 7px 4px; }
.hist { font-size: 12px; color: var(--mut); margin-top: 8px; border-top: 1px solid var(--line2); padding-top: 8px; }

/* ачивки */
.ach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ach { background: var(--card); border: 1px solid var(--line2); border-radius: 12px; padding: 10px 6px; text-align: center; opacity: .45; }
.ach.on { opacity: 1; border-color: var(--pink); }
.ach-e { font-size: 22px; }
.ach-t { font-size: 11px; font-weight: 700; margin-top: 4px; }
.ach-d { font-size: 10px; color: var(--mut); margin-top: 2px; }

/* график веса */
.chart { width: 100%; }
.chart .grid { stroke: var(--line2); stroke-width: 1; }
.chart .line { stroke: var(--pink); stroke-width: 2.5; fill: none; }
.chart .dot { fill: var(--pink); }
.chart .lbl { fill: var(--mut); font-size: 10px; }
.wrow { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line2); font-size: 13px; }
.wrow b { flex: 1; }
.wdel { border: none; color: var(--mut); font-size: 16px; padding: 0 6px; }

/* тост */
#toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: var(--pink); color: #fff;
  padding: 10px 18px; border-radius: 20px; font-weight: 600; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 10; }
#toast.show { opacity: 1; }

/* факт-инпуты как в прототипе */
.fact { display: flex; gap: 8px; }
.fact input { text-align: center; margin-bottom: 0; }
.fact .f { flex: 1; }
.fact .fl { font-size: 11px; color: var(--mut); text-align: center; margin-top: 3px; }
code.ref { display: block; background: var(--input); padding: 9px 10px; border-radius: 8px; font-size: 11px; color: var(--pink-bright); word-break: break-all; }
