/* Progres (lane B): the v4 Progres screen. Only --f-* tokens from forma.css.
   Mockup: mockups/finale/progres.html. Small quiet labels (.f-label), flat boxes (radius 24), calm numbers.
   Overrides here (instead of deleting them) the v3 rules in app.css (.cal-*, .note-field, .list in the day sheet)
   and shell.css (.sh-cal …, .pg-weight__now, .sh-day, .sheet .note-field), which the new markup no longer asks for
   or which still match the shared class names. */

/* ---------------------------------------------------------------- page */
.app .f-screen.pg { display: block; padding: env(safe-area-inset-top, 0px) 6px 0; }
.pg > .f-label:first-child { padding-top: calc(var(--f-s4) + 10px); }

/* period: small centred words */
.pg-period { display: flex; justify-content: center; gap: 26px; padding-top: 12px; }
.pg-period__b { min-height: var(--f-tap); font-size: 15.5px; font-weight: 500; color: var(--f-text-3); transition: color var(--f-dur-2) var(--f-ease); }
.pg-period__b.is-on { color: var(--f-text); }
.pg-period + .f-label { padding-top: 16px; }

/* a box: flat card, a bit tighter than .f-card */
.pg .pg-box, .sheet .pg-box { padding: 18px 20px; border-radius: var(--f-r-lg); }
.pg-row { display: flex; justify-content: space-between; align-items: center; gap: var(--f-s4); min-width: 0; }

/* the calm number with its small unit */
.pg-n { font-family: var(--f-font-num); font-size: var(--f-fs-num); font-weight: 500; line-height: 1; letter-spacing: var(--f-track-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pg-n small { font-family: var(--f-font); font-size: var(--f-fs-sub); font-weight: 400; letter-spacing: 0; color: var(--f-text-2); margin-left: 6px; }
.pg-n--sm { font-size: var(--f-fs-display); }

.pg-empty { font-size: var(--f-fs-sub); color: var(--f-text-2); padding: 2px 0 4px; }
.pg-empty--in { padding: 0; }

.pg-add { flex: none; }
.pg-add svg { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- two small tiles: trainings in a row, volume */
.pg-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-top: 26px; }
.pg .pg-tile { padding: 16px 18px 18px; border-radius: var(--f-r-lg); display: grid; align-content: space-between; gap: 14px; min-width: 0; }
.pg-tile__k { font-size: var(--f-fs-sub); font-weight: 500; color: var(--f-text-2); }
.pg-tile > .pg-tile__k { min-height: 22px; display: flex; align-items: center; }
.pg-tile .pg-n { font-size: clamp(26px, 8.4vw, 34px); display: flex; align-items: baseline; }
.pg-tile .pg-n small { margin-left: 4px; }
.pg-tile__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; min-height: 22px; }
.pg-minibars { width: 48px; height: 16px; flex: none; overflow: visible; }
/* the trainings in a row: one flame and the number */
.pg-streak { display: flex; align-items: center; gap: 4px; }
.pg-flame { width: 30px; height: 30px; margin-left: -4px; flex: none; }
.pg-flame path { fill: var(--f-accent); }
.pg-flame path + path { fill: #FFB98A; }
.pg-streak.is-off .pg-flame path { fill: var(--f-surface-3); }
.pg-streak.is-off .pg-flame path + path { fill: none; }

/* ---------------------------------------------------------------- Váha */
.pg .pg-weight { display: grid; gap: 14px; }
.pg-chart { display: block; width: 100%; height: auto; overflow: visible; }
.pg-chart__line { fill: none; stroke: var(--f-accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.pg-chart__rule { fill: none; stroke: var(--f-sep); stroke-width: 1; }
.pg-chart__dot--last { fill: var(--f-text); stroke: var(--f-accent); stroke-width: 3; }
/* reading the chart with a finger: a thin cream line and a dot on the picked weight (progress.js) */
.pg-wchart { touch-action: pan-y; cursor: crosshair; margin: -6px -4px; padding: 6px 4px; }
.pg-chart__scrub { display: none; }
.pg-wchart.is-scrub .pg-chart__scrub { display: inline; }
.pg-wchart.is-scrub .pg-chart__dot--last { opacity: 0.35; }
.pg-chart__cursor { stroke: var(--f-text-2); stroke-width: 1.5; }
.pg-chart__pick { fill: var(--f-text); stroke: var(--f-accent); stroke-width: 3; }

/* ---------------------------------------------------------------- Sila, Rekordy: picture, name, number */
.pg-lifts { display: grid; }
.pg-lift { width: 100%; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 7px 0; text-align: left; border-radius: var(--f-r-md); }
.pg-lift:active { opacity: 0.7; }
.pg-lift__pic { width: 56px; height: 56px; border-radius: 16px; overflow: hidden; background: var(--f-surface-1); display: block; }
.pg-lift__pic .pic, .pg-lift__pic > svg, .pg-lift__pic svg { width: 100%; height: 100%; display: block; }
.pg-lift__name { font-size: 16.5px; font-weight: 500; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: break-word; }
.pg-lift__v { text-align: right; font-family: var(--f-font-num); font-size: 22px; font-weight: 500; line-height: 1; letter-spacing: var(--f-track-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pg-lift__v b { font-weight: 500; }
.pg-lift__v small.is-up { color: var(--f-better); font-weight: 500; }
.pg-lift:has(> .pg-spark) { grid-template-columns: 56px minmax(0, 1fr) 56px minmax(44px, auto); }
.pg-spark { width: 56px; height: 26px; fill: none; stroke: var(--f-accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.pg-lift__v small { display: block; margin-top: 4px; font-family: var(--f-font); font-size: 13.5px; font-weight: 400; letter-spacing: 0; color: var(--f-text-2); }

/* "Všetky N" at the end of a label: quiet, full tap height without growing the label */
.pg-more { min-height: var(--f-tap); margin: -12px 0; font-size: var(--f-fs-sub); color: var(--f-text-2); }

/* ---------------------------------------------------------------- calendar (overrides app.css .cal-*) */
.pg .pg-cal { padding: 14px 12px 16px; display: grid; gap: var(--f-s2); }
.pg-cal .cal-head { margin: 0 0 var(--f-s1); }
.pg-cal .cal-title { font-size: var(--f-fs-body); font-weight: 500; text-align: center; min-width: 0; }
.pg-cal .cal-nav { width: var(--f-tap); height: var(--f-tap); color: var(--f-text); background: var(--f-quiet); }
.pg-cal .cal-nav svg { width: 8px; height: 14px; }
.pg-cal .cal-grid { gap: 2px; }
.pg-cal .cal-week span { font-size: 12px; font-weight: 500; color: var(--f-text-3); padding-bottom: 2px; }
.pg-cal .cal-day { color: var(--f-text-3); font-size: var(--f-fs-sub); font-weight: 500; box-shadow: none; background: none; }
.pg-cal .cal-day > span { line-height: 1; }
.pg-cal .cal-day.is-plan { color: var(--f-text-2); }
.pg-cal .cal-day.has-log { background: var(--f-quiet-pressed); color: var(--f-text); }
.pg-cal .cal-day.is-complete { background: var(--f-text); color: #141414; }
.pg-cal .cal-day.is-today { color: var(--f-accent-text); font-weight: 500; box-shadow: none; }
.pg-cal .cal-day.is-today.is-complete { color: var(--f-accent); }
.pg-cal .cal-day i { bottom: 9%; width: 4px; height: 4px; background: transparent; }
.pg-cal .cal-day.has-log i { background: transparent; }
.pg-cal .cal-day.has-photo i { background: var(--f-text-2); }
.pg-cal .cal-day.is-complete.has-photo i { background: #141414; }
.pg-cal .cal-day.is-pr::after { content: ""; position: absolute; top: 6%; right: 10%; width: 6px; height: 6px; border-radius: 50%; background: var(--f-better); }

/* ---------------------------------------------------------------- volume (the tile's bars) */
.pg-bar { fill: var(--f-quiet-pressed); }
.pg-bar--now { fill: var(--f-text); }

/* ---------------------------------------------------------------- photos (card) */
.pg .ph-card { display: grid; gap: 14px; }
.ph-hint { font-size: var(--f-fs-sub); color: var(--f-text-2); line-height: 1.4; margin: 0; }
.ph-months {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2 * 8px) / 3);
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.ph-months::-webkit-scrollbar { display: none; }
/* more than three months: the older one peeks in on the left, so it is clear the row moves */
.ph-months.is-scroll { grid-auto-columns: calc((100% - 3 * 8px) / 3.35); scroll-snap-type: x proximity; }
.ph-month {
  position: relative;
  display: grid;
  aspect-ratio: 3 / 4;
  border-radius: var(--f-r-md);
  overflow: hidden;
  scroll-snap-align: start;
  background: var(--f-surface-2);
  color: var(--f-text);
  text-align: left;
  padding: 0;
}
.ph-month__pic, .ph-month__pic img { position: absolute; inset: 0; width: 100%; height: 100%; }
.ph-month__pic img { display: block; object-fit: cover; }
.ph-month__name {
  position: absolute;
  left: 10px;
  bottom: 9px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.15;
  z-index: 1;
}
.ph-month__name small { display: block; font-size: 11.5px; font-weight: 400; color: var(--f-text-2); }
.ph-month.is-photo::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent);
}
.ph-month.is-photo .ph-month__name, .ph-month.is-photo .ph-month__name small { color: #fff; }
.ph-month__n {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  z-index: 1;
}
.ph-month.is-empty { box-sizing: border-box; background: none; border: 1.5px dashed var(--f-text-3); }
.ph-month__plus { place-self: center; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--f-quiet); }
.ph-month__plus svg { width: 13px; height: 13px; }
.ph-month.is-empty .ph-month__name { color: var(--f-text-2); }
.ph-month.is-empty.is-now { border-color: var(--f-text-2); }
.ph-month.is-empty.is-now .ph-month__name { color: var(--f-text); }
.ph-month.is-future { background: none; border: 1.5px dashed var(--f-surface-3); cursor: default; }
.ph-month.is-future .ph-month__name { color: var(--f-text-3); }
.ph-month:focus-visible, .ph-month.ph-add:focus-within { box-shadow: var(--f-focus); }
.ph-add-main { width: 100%; }
.ph-month.is-photo:active, .ph-month.is-empty:active { opacity: .75; }


/* ---------------------------------------------------------------- sheets from Progres: day, records */
.pg-chip { font-size: var(--f-fs-sub); color: var(--f-text-2); }
.sheet .pg-lifts { margin-top: var(--f-s2); }
.pg-day { display: grid; gap: var(--f-s3); }
.pg-day__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--f-s2); }
.pg-day__stats p { display: grid; gap: 6px; min-width: 0; }
.pg-day__stats span { font-size: var(--f-fs-caption); color: var(--f-text-2); }
.pg-day__pr { font-size: var(--f-fs-sub); color: var(--f-text); }
.pg-day__pr::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--f-better); margin: 0 8px 2px 0; }
.sheet .pg-day__list { margin-top: var(--f-s3); }
.sheet .ph-thumb { background: var(--f-surface-1); }
.sheet .note-field.pg-note { background: var(--f-surface-1); color: var(--f-text); box-shadow: none; border-radius: var(--f-r-md); font-family: var(--f-font); }
.sheet .note-field.pg-note::placeholder { color: var(--f-text-3); }
.sheet .note-field.pg-note:focus { outline: none; box-shadow: var(--f-focus-field); }

@media (prefers-reduced-motion: reduce) { .pg-period__b { transition: none; } }

/* photo viewer: the one flat page grey instead of black (overrides shell.css .ph-viewer) */
.ph-viewer { background: var(--f-bg); }
.ph-viewer [data-phv="close"]:focus-visible { box-shadow: var(--f-focus); }
