/* Сотня — стили */
:root {
  --bg: #F2F3EF;
  --surface: #FFFFFF;
  --surface-2: #E7E9E3;
  --ink: #17191E;
  --ink-2: #555A63;
  --ink-3: #8B9098;
  --line: #DCDFD7;
  --empty: #E1E3DC;
  --on-ink: #FFFFFF;

  --run: #EA5A2B;
  --swim: #1D7FE0;
  --circuit: #0E9F69;
  --stretch: #A057DD;
  --custom: #E39B07;
  --sick: #8C939C;
  --danger: #D33A2C;

  --f-display: 'Unbounded', 'Arial Black', system-ui, sans-serif;
  --f-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-cell: 6px;
  --r-ctl: 16px;
  --r-card: 24px;
  --r-sheet: 30px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #1A1D22;
    --surface-2: #252930;
    --ink: #F0F1ED;
    --ink-2: #A9AEB7;
    --ink-3: #6E747E;
    --line: #2B2F36;
    --empty: #22262C;
    --on-ink: #111317;
    --run: #FF6B3A;
    --swim: #3E95F0;
    --circuit: #1DBA7E;
    --stretch: #B57AEC;
    --custom: #F2AE20;
    --danger: #FF5A4B;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 16px/1.45 var(--f-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
:focus-visible { outline: 2.5px solid var(--swim); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3, p { margin: 0; }
.ico { width: 22px; height: 22px; flex: none; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.pad { padding: 4px 18px 10px; }

.view {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 18px) 16px calc(var(--safe-b) + 112px);
  display: flex; flex-direction: column; gap: 18px;
}

/* ---------- шапка ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hello { font-weight: 800; font-size: 20px; letter-spacing: -0.01em; }
.date { color: var(--ink-3); font-size: 14px; }
.lvl {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 6px; border-radius: 99px; background: var(--surface);
  border: 1px solid var(--line);
}
.lvl-n {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--on-ink); font: 800 15px var(--f-display);
}
.lvl-t { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; text-align: left; }
.lvl-bar { display: block; width: 64px; height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.lvl-bar i { display: block; height: 100%; background: var(--custom); border-radius: 4px; }

/* ---------- сотка ---------- */
.hero { display: flex; flex-direction: column; gap: 14px; }
.count { display: flex; align-items: flex-end; gap: 12px; }
.big {
  font: 800 clamp(88px, 27vw, 128px)/0.8 var(--f-display);
  letter-spacing: -0.06em;
  margin-left: -4px;
}
.of { font: 700 22px/1.1 var(--f-display); letter-spacing: -0.02em; padding-bottom: 2px; }
.of small { font: 600 14px/1.3 var(--f-body); color: var(--ink-3); letter-spacing: 0; }

.g100 {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px;
  cursor: pointer;
}
.cell {
  aspect-ratio: 1; border-radius: var(--r-cell); background: var(--empty); position: relative;
}
.cell.ms:not(.on) { box-shadow: inset 0 0 0 1.5px var(--ink-3); background: transparent; }
.cell.ms:not(.on)::after {
  content: attr(data-n); position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 9px var(--f-display); color: var(--ink-3);
}
.cell.on { background: var(--c); }
.cell.on.multi::after {
  content: ''; position: absolute; width: 28%; height: 28%; right: 16%; top: 16%; border-radius: 50%; background: rgba(255,255,255,.85);
}
.cell.next { background: transparent; box-shadow: inset 0 0 0 2px var(--ink); animation: nextPulse 1.8s ease-in-out infinite; }
@keyframes nextPulse { 50% { box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 4px color-mix(in srgb, var(--ink) 14%, transparent); } }
.cell.pop { animation: pop .7s cubic-bezier(.2,1.6,.4,1) .15s both; z-index: 1; }
@keyframes pop { 0% { transform: scale(0); background: var(--ink); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }

.hero-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.streak { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink-2); }
.streak b { font: 800 17px var(--f-display); color: var(--ink); }
.streak .ico { width: 20px; height: 20px; color: var(--ink-3); }
.streak.hot .ico { color: var(--run); fill: color-mix(in srgb, var(--run) 25%, transparent); }

/* ---------- неделя ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wd {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0 10px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
}
.wd-l { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: capitalize; }
.wd-m { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--f-display); }
.wd-m .ico { width: 17px; height: 17px; stroke-width: 3; }
.wd.done .wd-m { background: var(--c); color: #fff; }
.wd.sick .wd-m { background: var(--surface-2); color: var(--sick); }
.wd.miss .wd-m { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.wd.future { opacity: .5; background: transparent; }
.wd.today { border-color: var(--ink); border-width: 1.5px; }

/* ---------- карточки ---------- */
.card { background: var(--surface); border-radius: var(--r-card); padding: 18px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.today-q { font: 700 20px var(--f-display); letter-spacing: -0.02em; }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.qt {
  display: flex; align-items: center; gap: 10px; padding: 14px; min-height: 60px;
  border-radius: var(--r-ctl); font-weight: 800; font-size: 16px; text-align: left;
  background: color-mix(in srgb, var(--c) 11%, var(--surface));
  transition: transform .12s;
}
.qt .ico { color: var(--c); width: 26px; height: 26px; }
.qt:active { transform: scale(.97); }
.link-sick { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 14px; font-weight: 600; align-self: flex-start; padding: 4px 0; }
.link-sick .ico { width: 18px; height: 18px; }

.today-head { display: flex; gap: 14px; align-items: center; }
.today-head h2 { font: 700 18px var(--f-display); letter-spacing: -0.02em; }
.today-head p { color: var(--ink-2); font-size: 14px; }
.badge-ok, .badge-sick { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.badge-ok { background: var(--circuit); color: #fff; }
.badge-ok .ico { stroke-width: 3; }
.badge-sick { background: var(--surface-2); color: var(--sick); }

/* ---------- цитата ---------- */
.quote { margin: 6px 0 0; padding: 0 4px; }
.quote-mark { width: 30px; height: 24px; fill: var(--custom); margin-bottom: 10px; display: block; }
.quote blockquote { margin: 0; font: 700 21px/1.38 var(--f-body); letter-spacing: -0.012em; text-wrap: pretty; }
.quote figcaption { margin-top: 10px; color: var(--ink-3); font-size: 14px; font-weight: 600; }

/* ---------- записи ---------- */
.wlist { display: flex; flex-direction: column; gap: 8px; }
.wrow {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px; width: 100%; text-align: left;
  border-radius: 18px; background: var(--bg);
}
.card .wrow { background: var(--bg); }
.history .wrow, .sheet .wrow { background: var(--surface); border: 1px solid var(--line); }
.wrow-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--c); color: #fff; display: grid; place-items: center; flex: none; }
.wrow-ico .ico { width: 21px; height: 21px; }
.wrow-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.wrow-title { font-weight: 800; display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.wrow-date { font-weight: 600; font-size: 13px; color: var(--ink-3); }
.wrow-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.wrow-note { font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wrow-xp { font: 700 12px var(--f-display); color: var(--custom); padding-top: 2px; }
.chip { font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); white-space: nowrap; }
.chip-soft { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }

/* ---------- кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 20px; border-radius: var(--r-ctl); font-weight: 800; font-size: 16px;
  transition: transform .12s, background .2s;
}
.btn:active { transform: scale(.98); }
.btn .ico { width: 20px; height: 20px; }
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-ghost { background: var(--surface-2); }
.btn-danger-ghost { color: var(--danger); background: transparent; }
.btn-xl { height: 60px; font-size: 17px; border-radius: 18px; }
.btn-sm { height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.field input, .field textarea, .field select {
  width: 100%; border: 0; border-radius: 14px; background: var(--surface-2);
  padding: 14px; font-size: 17px; font-weight: 600; min-height: 52px; outline: none;
  transition: box-shadow .15s;
}
.field input:focus, .field textarea:focus { box-shadow: inset 0 0 0 2px var(--ink); }
.field textarea { resize: vertical; min-height: 64px; line-height: 1.4; }
.big-in input { font: 700 26px var(--f-display); letter-spacing: -0.02em; min-height: 66px; }
.big-in input::placeholder { color: var(--ink-3); opacity: .5; }
.pace { font-weight: 700; color: var(--run); min-height: 1em; margin-top: -4px; font-size: 15px; }

.mood { border: 0; padding: 0; margin: 0; }
.mood legend { font-size: 14px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.mood-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.mood label { min-width: 0; }
.mood input, .colors input { position: absolute; opacity: 0; pointer-events: none; }
.mood span {
  display: block; text-align: center; padding: 11px 2px; border-radius: 12px; background: var(--surface-2);
  font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s;
}
.mood input:checked + span { background: var(--ink); color: var(--on-ink); }
.mood input:focus-visible + span { outline: 2.5px solid var(--swim); outline-offset: 2px; }

.switch { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 15px; cursor: pointer; }
.switch input { width: 22px; height: 22px; accent-color: var(--circuit); }

/* ---------- страницы ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; }
.page-head h1 { font: 800 30px var(--f-display); letter-spacing: -0.04em; }
.h2 { font: 700 18px var(--f-display); letter-spacing: -0.02em; margin-top: 8px; }

/* календарь */
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 12px 16px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head h2 { font: 700 17px var(--f-display); text-transform: capitalize; letter-spacing: -0.02em; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.icon-btn:disabled { opacity: .25; }
.icon-btn:not(:disabled):active { background: var(--surface-2); }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-dow span { text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-3); padding-bottom: 6px; }
.cd {
  aspect-ratio: 1; border-radius: 12px; position: relative; display: grid; place-items: center;
  font: 600 14px var(--f-body); background: var(--bg);
}
.cd.empty { background: transparent; }
.cd.future { color: var(--ink-3); background: transparent; }
.cd.done { background: var(--c); color: #fff; }
.cd.done > span { position: absolute; top: 4px; left: 6px; font-size: 10px; font-weight: 800; opacity: .9; }
.cd-ok { width: 20px; height: 20px; stroke-width: 3; }
.cd.sick { background: repeating-linear-gradient(-45deg, var(--surface-2) 0 4px, transparent 4px 8px); color: var(--sick); }
.cd.sick > span { position: absolute; top: 4px; left: 6px; font-size: 10px; font-weight: 800; }
.cd.sick .cd-ok { stroke-width: 2.2; }
.cd.miss { color: var(--ink-3); background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.cd.today { box-shadow: inset 0 0 0 2px var(--ink); }
.cd.done.today { box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--surface); }
.cd.start::before { content: ''; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--ink); }
.cd.done.start::before { background: #fff; }
.dots { position: absolute; bottom: 4px; right: 5px; display: flex; gap: 2px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; box-shadow: 0 0 0 1px #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-sick { background: repeating-linear-gradient(-45deg, var(--sick) 0 2px, transparent 2px 4px); }
.lg-miss { box-shadow: inset 0 0 0 1.5px var(--ink-3); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile b { font: 700 20px var(--f-display); letter-spacing: -0.03em; overflow: hidden; text-overflow: ellipsis; }
.tile span { font-size: 12.5px; font-weight: 600; color: var(--ink-3); line-height: 1.25; }

.history { display: flex; flex-direction: column; gap: 14px; }
.hgroup { display: flex; flex-direction: column; gap: 8px; }
.hgroup h3 { font-size: 14px; font-weight: 700; color: var(--ink-3); padding-left: 4px; }
.hgroup h3::first-letter, .date::first-letter { text-transform: uppercase; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 28px 16px; color: var(--ink-2); }
.empty-state .ico { width: 36px; height: 36px; color: var(--ink-3); }

/* награды */
.level-card { display: flex; align-items: center; gap: 18px; background: var(--ink); color: var(--on-ink); border-radius: var(--r-card); padding: 20px; }
.level-ring {
  --p: 0; width: 88px; height: 88px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--custom) calc(var(--p) * 1%), color-mix(in srgb, var(--on-ink) 16%, transparent) 0);
}
.level-ring span { width: 70px; height: 70px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; font: 800 30px var(--f-display); letter-spacing: -0.04em; }
.level-info { display: flex; flex-direction: column; gap: 4px; }
.level-info h2 { font: 800 22px var(--f-display); letter-spacing: -0.03em; }
.level-info p { font-weight: 600; font-size: 15px; }
.level-info .muted { color: color-mix(in srgb, var(--on-ink) 55%, transparent); }

.medals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.medal { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.medal-disc {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-3);
}
.medal-disc .ico { width: 24px; height: 24px; }
.medal.on .medal-disc { background: var(--c); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }
.medal-body { display: flex; flex-direction: column; gap: 3px; }
.medal-body b { font-weight: 800; font-size: 15px; line-height: 1.25; }
.medal-body span { font-size: 13px; color: var(--ink-2); line-height: 1.3; }
.medal-body em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--ink-3); margin-top: 2px; }
.medal.on .medal-body em { color: var(--c); }
.medal:not(.on) .medal-body b { color: var(--ink-2); }
.mprog { display: block; height: 4px; border-radius: 4px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.mprog i { display: block; height: 100%; background: var(--ink-3); border-radius: 4px; }

/* настройки */
.form-card { padding: 18px; }
.list-card { padding: 6px 0; gap: 0; }
.lrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 18px; text-align: left; border-top: 1px solid var(--line); }
.lrow:first-child { border-top: 0; }
.list-card > p + .lrow { border-top: 0; }
.lrow > span:not(.lrow-dot) { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lrow b { font-weight: 700; }
.lrow small { color: var(--ink-3); font-size: 13px; font-weight: 600; }
.lrow .ico { color: var(--ink-3); width: 20px; height: 20px; }
.lrow.add b { color: var(--circuit); }
.lrow.add .ico { color: var(--circuit); }
.lrow.danger b, .lrow.danger .ico { color: var(--danger); }
.lrow-dot { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.install { padding: 0 4px; line-height: 1.5; }

/* ---------- таббар ---------- */
.tabbar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 20;
  width: 100%; max-width: 520px;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: stretch;
  padding: 0 8px var(--safe-b);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.onb-mode .tabbar { display: none; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; padding: 10px 0 10px; color: var(--ink-3); font-size: 11.5px; font-weight: 700; }
.tab[aria-current="page"] { color: var(--ink); }
.tab-add { padding: 0; }
.tab-add-in {
  width: 56px; height: 56px; border-radius: 20px; background: var(--ink); color: var(--on-ink);
  display: grid; place-items: center; margin-top: -22px; box-shadow: 0 8px 20px -6px rgba(0,0,0,.35);
  transition: transform .15s;
}
.tab-add:active .tab-add-in { transform: scale(.94); }
.tab-add .ico { width: 26px; height: 26px; }

/* ---------- шторки ---------- */
.sheet-root { position: fixed; inset: 0; z-index: 40; }
.sheet-back { position: absolute; inset: 0; background: rgba(10, 12, 15, .45); opacity: 0; transition: opacity .25s; width: 100%; }
.sheet {
  position: absolute; left: 50%; bottom: 0; width: 100%; max-width: 520px;
  max-height: 90vh; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding: 8px 18px calc(var(--safe-b) + 22px);
  transform: translate(-50%, 100%); transition: transform .3s cubic-bezier(.2,.9,.3,1);
  display: flex; flex-direction: column; gap: 14px;
}
.sheet.tall { min-height: 70vh; }
.sheet-root.open .sheet { transform: translate(-50%, 0); }
.sheet-root.open .sheet-back { opacity: 1; }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 2px auto 6px; flex: none; }
.sheet-title { font: 800 24px/1.15 var(--f-display); letter-spacing: -0.035em; }
.sheet-sub { color: var(--ink-2); font-size: 15px; margin-top: -6px; text-wrap: pretty; }
.sheet-sub:first-letter { text-transform: uppercase; }
.sheet-type { display: flex; align-items: center; gap: 12px; }
.sheet-type > .ico { width: 44px; height: 44px; padding: 10px; border-radius: 14px; background: var(--c); color: #fff; }

.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 16px; border-radius: 20px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); transition: transform .12s;
}
.type-tile:active { transform: scale(.97); }
.tt-ico { width: 46px; height: 46px; border-radius: 15px; background: var(--c); color: #fff; display: grid; place-items: center; margin-bottom: 10px; }
.tt-ico .ico { width: 24px; height: 24px; }
.type-tile b { font-weight: 800; font-size: 17px; }
.type-tile small { color: var(--ink-3); font-size: 13px; font-weight: 600; }
.type-tile.ghost { background: transparent; border-style: dashed; }
.type-tile.ghost .tt-ico { background: var(--surface-2); color: var(--ink-2); }

.prog-list { display: flex; flex-direction: column; gap: 8px; }
.prog { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); text-align: left; transition: transform .12s; }
.prog:active { transform: scale(.985); }
.prog-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.prog-top b { font-weight: 800; font-size: 16.5px; }
.prog-meta { font: 700 12px var(--f-display); color: var(--circuit); white-space: nowrap; }
.prog-ex { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.prog-ex i { font-style: normal; font-weight: 800; color: var(--ink); }

.pd-stats { display: flex; gap: 18px; font-weight: 600; color: var(--ink-2); }
.pd-stats b { font: 800 22px var(--f-display); color: var(--ink); letter-spacing: -0.03em; margin-right: 4px; }
.steppers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stepper { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.stepper > span { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.stepper > div { display: flex; align-items: center; justify-content: space-between; }
.stepper b { font: 800 22px var(--f-display); letter-spacing: -0.03em; }
.stepper button { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); font-size: 22px; font-weight: 700; line-height: 1; }

.ladder-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px 14px 10px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.ladder { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px; height: 110px; }
.lcol { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lbars { flex: 1; display: flex; align-items: flex-end; gap: 1.5px; }
.lbars i { flex: 1; background: var(--circuit); opacity: var(--o); border-radius: 3px 3px 1px 1px; min-height: 3px; }
.lcol > span { text-align: center; font: 700 10px var(--f-display); color: var(--ink-3); }
.ltable { width: 100%; border-collapse: collapse; font-size: 13px; display: block; overflow-x: auto; }
.ltable th, .ltable td { padding: 6px 5px; text-align: center; white-space: nowrap; font-weight: 600; }
.ltable thead th { color: var(--ink-3); font-size: 11.5px; font-weight: 700; }
.ltable tbody th { text-align: left; font-weight: 700; position: sticky; left: 0; background: var(--surface); padding-right: 10px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.ltable tbody tr + tr > * { border-top: 1px solid var(--line); }
.ltable .tot { font-weight: 800; color: var(--circuit); }

.exlist { display: flex; flex-direction: column; gap: 10px; }
.exr { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.exr-top { display: flex; gap: 6px; }
.exr-top input { flex: 1; min-width: 0; border: 0; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-weight: 700; outline: none; }
.exr-top .icon-btn { color: var(--ink-3); }
.exr-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.exr-nums label { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.exr-nums span { font-size: 11px; font-weight: 700; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exr-nums input, .exr-nums select { width: 100%; min-width: 0; border: 0; background: var(--surface-2); border-radius: 10px; padding: 9px 8px; font-weight: 800; font-size: 16px; outline: none; }

.colors { border: 0; padding: 0; margin: 0; }
.colors legend { font-size: 14px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.colors > div { display: flex; gap: 10px; flex-wrap: wrap; }
.colors span { display: block; width: 42px; height: 42px; border-radius: 12px; background: var(--c); cursor: pointer; transition: transform .15s; }
.colors input:checked + span { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--c); transform: scale(.92); }

.reps-sum { display: flex; flex-wrap: wrap; gap: 6px 14px; font-weight: 600; color: var(--ink-2); font-size: 14.5px; }
.reps-sum b { font: 800 16px var(--f-display); color: var(--ink); }

/* ---------- сессия круговой ---------- */
.session-root { position: fixed; inset: 0; z-index: 30; background: var(--bg); overflow-y: auto; }
.ss {
  max-width: 520px; margin: 0 auto; min-height: 100%;
  padding: calc(var(--safe-t) + 10px) 16px calc(var(--safe-b) + 20px);
  display: flex; flex-direction: column; gap: 16px;
}
.ss-top { display: flex; align-items: center; gap: 8px; }
.ss-title { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.ss-title b { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ss-title span { font: 600 13px var(--f-display); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ss-r { width: 40px; text-align: center; font: 700 13px var(--f-display); color: var(--ink-3); }
.ss-prog { display: flex; gap: 4px; }
.ss-prog i { flex: 1; height: 6px; border-radius: 3px; background: var(--empty); transition: background .3s; }
.ss-prog i.d { background: var(--circuit); }
.ss-prog i.c { background: var(--ink); }

.ss-round { display: flex; align-items: baseline; gap: 12px; padding: 4px 2px 0; }
.ss-round span { font: 700 22px var(--f-display); color: var(--ink-3); letter-spacing: -0.02em; }
.ss-round b { font: 800 84px/0.9 var(--f-display); letter-spacing: -0.06em; }
.ss-ex { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.exb {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 22px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); min-height: 88px;
  transition: background .2s, color .2s, transform .12s;
}
.exb:active { transform: scale(.985); }
.exb-n { font: 800 44px/1 var(--f-display); letter-spacing: -0.05em; min-width: 82px; display: flex; flex-direction: column; }
.exb-n small { font: 700 12px var(--f-body); letter-spacing: 0; color: var(--ink-3); margin-top: 4px; }
.exb-name { flex: 1; font-weight: 800; font-size: 18px; line-height: 1.25; }
.exb-box { width: 34px; height: 34px; border-radius: 11px; box-shadow: inset 0 0 0 2px var(--line); display: grid; place-items: center; flex: none; }
.exb-box .ico { width: 20px; height: 20px; stroke-width: 3; opacity: 0; transform: scale(.4); transition: .2s cubic-bezier(.2,1.6,.4,1); }
.exb.on { background: var(--circuit); border-color: var(--circuit); color: #fff; }
.exb.on .exb-n small { color: rgba(255,255,255,.75); }
.exb.on .exb-box { box-shadow: none; background: rgba(255,255,255,.22); }
.exb.on .exb-box .ico { opacity: 1; transform: scale(1); }
.ss-cta { position: sticky; bottom: calc(var(--safe-b) + 12px); }
.ss-cta.ready { background: var(--circuit); color: #fff; }

.ss-rest { background: #15171B; color: #F0F1ED; min-height: 100vh; min-height: 100dvh; }
.session-root:has(.ss-rest) { background: #15171B; }
.ss-rest .ss-title span, .ss-rest .ss-r { color: #8B9098; }
.ss-rest .ss-prog i { background: #2A2E35; }
.ss-rest .ss-prog i.d { background: var(--circuit); }
.ss-rest .ss-prog i.c { background: #F0F1ED; }
.ss-rest .icon-btn { color: #F0F1ED; }
.rest { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; }
.rest-ring { position: relative; width: min(72vw, 290px); aspect-ratio: 1; }
.rest-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rr-bg { fill: none; stroke: #2A2E35; stroke-width: 12; }
.rr-fg { fill: none; stroke: var(--circuit); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 1000; transition: stroke-dashoffset .25s linear; }
.rest-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rest-in span { font-weight: 700; color: #8B9098; font-size: 16px; }
.rest-in b { font: 800 88px/1 var(--f-display); letter-spacing: -0.06em; font-variant-numeric: tabular-nums; }
.rest-next { text-align: center; display: flex; flex-direction: column; gap: 8px; }
.rest-next > span { font: 700 15px var(--f-display); color: #8B9098; }
.rest-next p { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-weight: 600; font-size: 16px; }
.rest-next b { font-family: var(--f-display); }
.ss-rest .row2 { width: 100%; }
.ss-rest .btn-ghost { background: #2A2E35; color: #F0F1ED; }
.ss-rest .btn-primary { background: #F0F1ED; color: #15171B; }

.fin { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.fin-burst { width: 84px; height: 84px; border-radius: 28px; background: var(--custom); color: #fff; display: grid; place-items: center; align-self: center; margin-top: 10px; animation: pop .7s cubic-bezier(.2,1.6,.4,1) both; }
.fin-burst .ico { width: 42px; height: 42px; }
.fin h2 { font: 800 28px/1.1 var(--f-display); letter-spacing: -0.04em; text-align: center; }
.fin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fin-stats span { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.fin-stats b { font: 800 26px var(--f-display); color: var(--ink); letter-spacing: -0.04em; }

/* ---------- онбординг ---------- */
.onb { display: flex; flex-direction: column; gap: 22px; padding-top: 10px; }
.onb-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; width: min(100%, 300px); }
.onb-grid i { aspect-ratio: 1; border-radius: 6px; background: var(--empty); animation: onbFill 4s var(--d) ease-in-out infinite; }
.onb-grid i:nth-child(5n+1) { --fc: var(--run); }
.onb-grid i:nth-child(5n+2) { --fc: var(--circuit); }
.onb-grid i:nth-child(5n+3) { --fc: var(--swim); }
.onb-grid i:nth-child(5n+4) { --fc: var(--circuit); }
.onb-grid i:nth-child(5n) { --fc: var(--stretch); }
@keyframes onbFill { 0%, 10% { background: var(--empty); } 30%, 70% { background: var(--fc); } 90%, 100% { background: var(--empty); } }
.onb-title { font: 800 40px/1.02 var(--f-display); letter-spacing: -0.05em; }
.onb-text { font-size: 17px; color: var(--ink-2); line-height: 1.5; text-wrap: pretty; }
.onb-form { display: flex; flex-direction: column; gap: 14px; }

/* ---------- тосты и конфетти ---------- */
.toasts { position: fixed; top: calc(var(--safe-t) + 12px); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px;
  background: var(--ink); color: var(--on-ink); font-weight: 700; font-size: 15px;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.45);
  transform: translateY(-20px); opacity: 0; transition: transform .3s cubic-bezier(.2,1.3,.4,1), opacity .25s;
}
.toast.in { transform: none; opacity: 1; }
.toast-ico { width: 34px; height: 34px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; flex: none; }
.toast-ico .ico { width: 18px; height: 18px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: 62%; border-radius: 2px; animation: conf 2.3s var(--d) cubic-bezier(.15,.7,.4,1) both; }
@keyframes conf {
  0% { transform: translate(-50%, 0) rotate(0); opacity: 1; }
  35% { transform: translate(calc(var(--x) - 50%), var(--y)) rotate(calc(var(--r) * .5)); opacity: 1; }
  100% { transform: translate(calc(var(--x) * 1.15 - 50%), calc(var(--y) + 75vh)) rotate(var(--r)); opacity: 0; }
}

@media (min-width: 560px) {
  .view { padding-top: 36px; }
  .tabbar { bottom: 14px; border: 1px solid var(--line); border-radius: 26px; width: calc(100% - 28px); padding-bottom: 8px; }
}
@media (max-width: 360px) {
  .quick, .type-grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .medals { grid-template-columns: 1fr; }
  .exb-n { font-size: 36px; min-width: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
