/* Светлая тема в духе Gym Workout Planner: синяя шапка, белые карточки, жирные заголовки. */
:root {
  --blue: #3447d8;
  --blue-dark: #2737b8;
  --bg: #f1f2f6;
  --card: #ffffff;
  --text: #101114;
  --hint: #8a8f9c;
  --good: #22b07d;
  --warn: #f0a531;
  --bad: #e5484d;
  --line: #e6e8ee;
  --radius: 22px;
  /* «человечек» */
  --b-base: #d5d9e2;
  --m-base: #c4cad6;
  --m-pri: #e8453c;
  --m-sec: #f3a19b;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI", sans-serif; }
main { padding: 0 0 calc(84px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
body.sub main { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
body.sub .tabs { display: none; }
.wrap { padding: 12px 12px 0; }
h1 { font-size: 26px; font-weight: 900; margin: 4px 2px 12px; letter-spacing: -.3px; }
h2 { font-size: 18px; font-weight: 800; margin: 20px 4px 10px; }
.muted { color: var(--hint); font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.card { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { opacity: .35; }
.btn { background: var(--blue); color: #fff; border-radius: 14px; padding: 13px 16px; font-weight: 800; width: 100%;
  letter-spacing: .2px; }
.btn:active { background: var(--blue-dark); }
.btn.big { padding: 16px; font-size: 19px; text-transform: uppercase; border-radius: 14px; }
.btn.outline { background: #fff; color: var(--text); border: 1.5px solid #d9dce4; }
.btn.secondary { background: #e9ecfb; color: var(--blue); }
.btn.danger { background: #fdecec; color: var(--bad); }
.btn.white { background: #fff; color: var(--blue); }
.btn.small { width: auto; padding: 8px 13px; font-size: 14px; border-radius: 11px; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--hint);
  font-size: 18px; flex: none; }
.icon-btn:active { background: var(--line); }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1.5px solid transparent;
  border-radius: 12px; padding: 10px 11px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); background: #fff; }
label.field { display: block; margin-bottom: 10px; }
label.field > span { display: block; font-size: 13px; color: var(--hint); margin-bottom: 4px; }
label.check-line { display: flex; gap: 8px; align-items: center; margin: 6px 2px 12px; font-size: 14px; }
label.check-line input { width: 20px; height: 20px; accent-color: var(--blue); }

/* blue header */
.hero { background: var(--blue); color: #fff; padding: 14px 18px 22px; position: relative; }
.hero .back { color: #fff; font-size: 30px; line-height: 1; padding: 0 10px 6px 0; font-weight: 300; }
.hero-t { font-size: 27px; font-weight: 900; text-transform: uppercase; letter-spacing: -.2px; line-height: 1.12; }
.hero-s { opacity: .85; margin-top: 6px; font-size: 15px; }
.hero + .wrap { margin-top: -10px; }
.wrap > .ss:first-child { margin-top: 20px; }
.hero .strip { margin: 14px 0 0; }
.hero .pill { background: rgba(255, 255, 255, .14); }
.hero .pill small { color: rgba(255, 255, 255, .75); }
.hero .up { color: #9ff0c9; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff;
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.tabs button { flex: 1; padding: 8px 0 10px; font-size: 11px; color: var(--hint); display: flex; flex-direction: column;
  align-items: center; gap: 2px; font-weight: 600; }
.tabs button span { font-size: 21px; filter: grayscale(1); opacity: .6; }
.tabs button.active { color: var(--blue); }
.tabs button.active span { filter: none; opacity: 1; }

/* pills */
.strip { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.pill { background: var(--card); border-radius: 14px; padding: 8px 12px; flex: none; }
.pill b { display: block; font-size: 16px; }
.pill small { color: var(--hint); font-size: 11px; }
.up { color: var(--good); } .down { color: var(--bad); }
.praise { border-left: 4px solid var(--good); }
.advice { border-left: 4px solid var(--warn); }

/* «человечек» */
.bd { display: block; width: 100%; height: 100%; }
.bd .b { fill: var(--b-base); }
.bd .m { fill: var(--m-base); }
.bd .m.s { fill: var(--m-sec); }
.bd .m.p { fill: var(--m-pri); }
.on-blue { --b-base: rgba(255, 255, 255, .35); --m-base: rgba(255, 255, 255, .5); --m-pri: #ff6b5e; --m-sec: #ffb3aa; }

/* day cards on home */
.dcard { background: var(--card); border-radius: var(--radius); padding: 16px 14px 16px 18px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px; cursor: pointer; }
.dcard:active { transform: scale(.99); }
.dname { font-size: 20px; font-weight: 900; text-transform: uppercase; line-height: 1.15; }
.dsub { color: var(--hint); font-size: 14px; margin-top: 4px; }
.dfig { width: 92px; height: 78px; flex: none; }
.tag { display: inline-block; margin-top: 8px; background: #e9ecfb; color: var(--blue); font-size: 11px; font-weight: 800;
  padding: 4px 8px; border-radius: 8px; letter-spacing: .4px; }

/* exercise cards (day screen, program) */
.xcard { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; display: flex;
  align-items: center; gap: 16px; cursor: pointer; }
.xthumb { width: 80px; height: 80px; border-radius: 14px; background: #f3f4f7; flex: none; position: relative;
  display: grid; place-items: center; font-size: 26px; overflow: hidden; }
.xthumb img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.xthumb .mini { position: absolute; right: 2px; bottom: 2px; width: 26px; height: 44px; background: rgba(255, 255, 255, .92);
  border-radius: 7px; padding: 2px; }
.xthumb.sm { width: 56px; height: 56px; border-radius: 12px; }
.xthumb.sm .mini { width: 19px; height: 32px; border-radius: 5px; }
.xtitle { font-size: 19px; font-weight: 800; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.xsub { color: var(--text); opacity: .7; font-size: 15px; margin-top: 4px; }
.xnote { color: var(--hint); font-size: 13px; margin-top: 2px; }
.ss { position: relative; margin-bottom: 10px; padding-left: 14px; }
.ss::before { content: ""; position: absolute; left: 3px; top: 30px; bottom: 14px; width: 4px; border-radius: 2px;
  background: var(--blue); }
.ss-label { font-size: 12px; font-weight: 900; color: var(--blue); letter-spacing: .6px; margin: 0 0 6px 2px; }
.ss .xcard { margin-bottom: 6px; }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, var(--bg) 18%);
  padding: 18px 26px calc(14px + env(safe-area-inset-bottom)); z-index: 12; max-width: 640px; margin: 0 auto;
  display: grid; gap: 10px; }

/* compact rows (program editor, lists in sheets) */
.ex-row { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ex-row:last-child { border-bottom: 0; }
.ex-title { font-weight: 700; }
.ex-sub { color: var(--hint); font-size: 13px; }
.link-ss { font-size: 12px; color: var(--blue); font-weight: 800; padding: 0 0 4px 68px; margin-top: -4px; }

/* workout player */
.pl-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: #fff; }
.pl-top button { font-size: 22px; width: 42px; height: 42px; border-radius: 12px; }
.pl-clock { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 17px; }
.pl-media { position: relative; background: #fff; height: 34vh; min-height: 210px; max-height: 330px; }
.pl-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pl-media .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--hint); }
.pl-fig { position: absolute; right: 8px; bottom: 8px; width: 92px; height: 78px; background: rgba(255, 255, 255, .92);
  border-radius: 12px; padding: 4px; box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
.pl-dots { display: flex; gap: 5px; justify-content: center; padding: 10px 0 0; flex-wrap: wrap; }
.pl-dots i { width: 22px; height: 5px; border-radius: 3px; background: #d9dce4; }
.pl-dots i.done { background: #9fb0f5; }
.pl-dots i.cur { background: var(--blue); }
.pl-head { padding: 10px 16px 0; display: flex; gap: 8px; align-items: flex-start; }
.pl-title { font-size: 23px; font-weight: 900; line-height: 1.15; }
.pl-sub { color: var(--hint); margin-top: 4px; font-size: 14px; }
.pl-ss { display: inline-block; background: #e9ecfb; color: var(--blue); font-weight: 800; font-size: 12px;
  padding: 3px 8px; border-radius: 8px; margin-top: 6px; }
.pl-actions { display: flex; gap: 8px; padding: 10px 16px 0; overflow-x: auto; scrollbar-width: none; }
.pl-actions button { background: #fff; border-radius: 12px; padding: 8px 12px; font-size: 14px; font-weight: 700;
  white-space: nowrap; }
.pl-body { padding: 4px 12px 0; }
.hint { font-size: 13px; background: #e5f6ef; color: #158a60; padding: 8px 11px; border-radius: 12px; margin: 10px 0 0; }
.prev { font-size: 13px; color: var(--hint); margin: 10px 4px 0; }
.sets { background: #fff; border-radius: var(--radius); margin-top: 12px; overflow: hidden; }
.srow { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line);
  cursor: pointer; }
.srow:last-child { border-bottom: 0; }
.sn { width: 30px; height: 30px; border-radius: 50%; background: var(--bg); display: grid; place-items: center;
  font-weight: 800; flex: none; font-size: 14px; }
.srow.done .sn { background: var(--good); color: #fff; }
.sval { font-size: 17px; font-weight: 700; }
.srow:not(.done) .sval { color: var(--hint); font-weight: 600; }
.sprev { margin-left: auto; color: var(--hint); font-size: 12px; }
.srow.cur { background: #f5f7ff; flex-wrap: wrap; cursor: default; padding: 14px 12px; }
.srow.cur .sn { background: var(--blue); color: #fff; }
.steppers { display: flex; gap: 10px; flex: 1; min-width: 0; }
.stepper { flex: 1; min-width: 0; background: #fff; border-radius: 14px; border: 1.5px solid #dfe3f3; display: flex;
  align-items: center; }
.stepper button { width: 40px; height: 52px; font-size: 24px; color: var(--blue); font-weight: 500; flex: none; }
.stepper .val { flex: 1; min-width: 0; text-align: center; }
.stepper input { text-align: center; font-size: 22px; font-weight: 900; padding: 6px 0 0; background: transparent;
  border: 0; }
.stepper small { display: block; font-size: 11px; color: var(--hint); margin-top: -3px; }
.pl-more { display: flex; gap: 8px; margin-top: 10px; }
.pl-more .btn { flex: 1; }
.pl-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; max-width: 640px; margin: 0 auto;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 10px;
  background: linear-gradient(transparent, var(--bg) 22%); }
.pl-bottom .nav { width: 58px; flex: none; background: #fff; border-radius: 14px; font-size: 26px; color: var(--blue); }
.pl-bottom .btn { flex: 1; }
.pl-bottom .btn.finish { background: var(--good); }

/* rest screen */
.rest { position: fixed; inset: 0; z-index: 40; background: var(--blue); color: #fff; display: flex;
  flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.rest-l { font-size: 22px; font-weight: 900; letter-spacing: 1px; }
.rest-t { font-size: 88px; font-weight: 900; font-variant-numeric: tabular-nums; margin: 6px 0; }
.rest-next { opacity: .85; margin-bottom: 26px; font-size: 16px; }
.rest-adj { display: flex; gap: 12px; margin-bottom: 30px; }
.rest-adj button { background: rgba(255, 255, 255, .16); color: #fff; border-radius: 14px; padding: 12px 20px;
  font-weight: 800; font-size: 17px; }
.rest .btn { max-width: 340px; }

/* sheet */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet.hidden { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 12, 30, .45); }
.sheet-body { position: absolute; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow-y: auto; background: #fff;
  border-radius: 24px 24px 0 0; padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); max-width: 640px;
  margin: 0 auto; animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { margin-top: 0; }
.results .ex-row { cursor: pointer; }
.results .ex-row:active { background: var(--bg); }
.info-media { position: relative; background: #f3f4f7; border-radius: 18px; height: 230px; overflow: hidden; }
.info-media img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.info-fig { display: flex; gap: 14px; align-items: center; margin: 12px 0; }
.info-fig .fig { width: 150px; height: 124px; flex: none; }
.legend { font-size: 13px; color: var(--hint); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
ol.instr { padding-left: 20px; color: #555a66; font-size: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.chip { padding: 7px 13px; border-radius: 20px; background: var(--bg); font-size: 14px; font-weight: 600; }
.chip.active { background: var(--blue); color: #fff; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.menu-list .btn { margin-bottom: 10px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom));
  background: rgba(16, 17, 20, .86); color: #fff; padding: 10px 15px; border-radius: 14px; z-index: 60;
  font-size: 14px; max-width: 90vw; }
.hidden { display: none !important; }

/* progress */
.chart { width: 100%; height: auto; display: block; }
.chart .dot { fill: #b8bfd0; }
.chart .avg { fill: none; stroke: var(--blue); stroke-width: 2.5; }
.chart .start { stroke: var(--hint); stroke-dasharray: 4 4; }
.chart text { fill: var(--hint); font-size: 10px; }
.lift { padding: 9px 0; border-bottom: 1px solid var(--line); }
.lift:last-child { border-bottom: 0; }
.bar { height: 6px; border-radius: 3px; background: var(--line); margin-top: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--good); border-radius: 3px; }
.empty { text-align: center; color: var(--hint); padding: 26px 10px; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
