/* Steelquake — „sportowa tablica”.
   Czerń OLED, kreda, jedna rodzina Archivo (wąska i bardzo gruba dla cyfr, normalna dla tekstu).
   Kolor zawsze coś znaczy: żółty = seria, niebieski = przerwa, pomarańczowy = zmiana ciężaru.
   Poza treningiem żółty jest zarezerwowany dla przycisku startu. */

:root {
  --black: #000;
  --graphite: #191a1c;
  --graphite-2: #222326;
  --steel: #2a2c30;
  --steel-2: #3a3d42;
  --chalk: #f2efe8;
  --dust: #8f8c86;
  --dust-2: #bdb9b1;
  --signal: #ffd400;
  --rest: #4ea8ff;
  --change: #ff7a1a;
  --danger: #ff5a4f;
  --font: 'Archivo', 'Arial Narrow', system-ui, sans-serif;
  --pad: clamp(16px, 4.6vw, 28px);
  --max: 720px;
  --tab-h: 64px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --r-s: 10px;
  --r-m: 14px;
  --r-l: 22px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--black); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--black);
  color: var(--chalk);
  font: 400 16px/1.45 var(--font);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, p { overflow-wrap: break-word; }
.icon { width: 22px; height: 22px; flex: none; }
:focus-visible { outline: 3px solid var(--chalk); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--dust); }
.small { font-size: 13px; }

/* ---------------------------------------------------------------- typografia */

.screen-title, .next-code, .plan-hero, .plan-code, .eyebrow-code, .login-mark, .stats dd, .hist-date b, .ex-num, .wk-big {
  font-stretch: 62%;
  font-weight: 900;
  letter-spacing: -0.012em;
  font-variant-numeric: tabular-nums;
  line-height: 0.86;
}
.screen-title { font-size: clamp(46px, 12vw, 76px); margin: 10px 0 14px; }
.lead { color: var(--dust-2); font-size: 17px; max-width: 60ch; margin: 0 0 18px; }
.group-title { font-size: 14px; font-weight: 700; color: var(--dust); margin: 32px 0 10px; letter-spacing: 0.01em; }

/* ---------------------------------------------------------------- układ */

#screen { min-height: 100dvh; outline: none; }
.screen {
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--pad) + var(--safe-t)) var(--pad) calc(var(--tab-h) + var(--safe-b) + 48px);
}
.splash { min-height: 100dvh; display: grid; place-items: center; }
.noscript { padding: 24px; }

.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(0, 0, 0, 0.88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--steel);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  color: var(--dust);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
/* Sześć zakładek na 360 px: etykiety w zwężonym kroju Archivo, żeby „Biblioteka” mieściła się w 60 px. */
.tab span { max-width: 100%; font-stretch: 78%; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.tab.active { color: var(--chalk); }
.tab.active .icon { stroke-width: 2.6; }

@media (min-width: 900px) {
  .tabbar {
    inset: 0 0 auto 0;
    height: 64px;
    padding: 0;
    border-top: 0;
    border-bottom: 1px solid var(--steel);
    grid-template-columns: repeat(6, auto);
    justify-content: center;
    gap: 34px;
  }
  .tab { flex-direction: row; gap: 8px; font-size: 15px; }
  .tab span { font-stretch: 100%; letter-spacing: 0; }
  .screen { padding-top: 104px; padding-bottom: 72px; }
}

/* ---------------------------------------------------------------- przyciski i kontrolki */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--r-m);
  background: var(--steel);
  color: var(--chalk);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, background-color 0.15s ease;
}
.button:active { transform: scale(0.98); }
.button[disabled] { opacity: 0.38; cursor: default; }
.button-primary { background: var(--chalk); color: #000; }
.button-primary[data-action="start"], .button-primary[data-action="plan-start"], .button-primary[data-action="resume"] { background: var(--signal); }
.button-quiet { background: transparent; border-color: var(--steel-2); }
.button-danger { background: var(--danger); color: #000; }
.button-danger-quiet { background: transparent; color: var(--danger); border-color: rgba(255, 90, 79, 0.45); }
.button-big { min-height: 60px; padding: 0 26px; font-size: 18px; }
.wide { width: 100%; }
.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--chalk);
  cursor: pointer;
}
.icon-button[disabled] { opacity: 0.3; }
.link-button {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--chalk);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--dust-2); font-weight: 700; text-decoration: none; margin-left: -6px; }
.actions { display: grid; gap: 10px; margin: 18px 0; }
.actions .button-big { width: 100%; }
/* Pasek zakładek jest na dole poniżej 900 px, więc przyklejone przyciski stoją nad nim. */
.sticky-actions {
  position: sticky;
  bottom: calc(var(--tab-h) + var(--safe-b) + 8px);
  z-index: 5;
  padding: 14px 0 6px;
  background: linear-gradient(transparent, var(--black) 28%);
}

.stepper {
  display: inline-grid;
  grid-template-columns: 46px minmax(88px, auto) 46px;
  align-items: center;
  border: 1px solid var(--steel);
  border-radius: var(--r-m);
  background: var(--graphite);
}
.stepper-button {
  height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--chalk);
  cursor: pointer;
}
.stepper-button:active { background: var(--steel); }
.stepper-value { padding: 0 6px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stepper-large { grid-template-columns: 64px minmax(150px, 1fr) 64px; width: 100%; }
.stepper-large .stepper-button { height: 60px; }
.stepper-large .stepper-value { font-size: 22px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--steel-2);
  border-radius: 999px;
  background: transparent;
  color: var(--chalk);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.chip.selected { background: var(--chalk); border-color: var(--chalk); color: #000; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid var(--steel-2);
  border-radius: 999px;
  color: var(--dust-2);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.badge .icon { width: 13px; height: 13px; }
.badge-strong { border-color: var(--chalk); color: var(--chalk); }
.badge-link { text-decoration: none; color: var(--chalk); }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], select, textarea, .select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--steel-2);
  border-radius: var(--r-m);
  background: var(--black);
  color: var(--chalk);
}
.select { width: auto; min-height: 46px; background: var(--graphite); border-color: var(--steel); }
textarea { min-height: 84px; resize: vertical; }
.field { display: grid; gap: 6px; align-content: start; }
.field-label { font-size: 14px; font-weight: 700; color: var(--dust-2); }
.field-hint { display: block; font-size: 13px; color: var(--dust); }
.form-message { min-height: 1.4em; margin: 0; font-weight: 600; }
.form-message.error { color: var(--danger); }
.form-message.ok { color: var(--chalk); }
.stack { display: grid; gap: 14px; }

.notice {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--steel);
  border-radius: var(--r-l);
  background: var(--graphite);
}
.notice p { margin: 4px 0 0; color: var(--dust-2); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice-strong { border-color: var(--signal); }
.notice-error { border-color: var(--danger); }
.notice-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.banners { position: sticky; top: 0; z-index: 30; }
.banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: calc(10px + var(--safe-t)) var(--pad) 10px;
  border-bottom: 1px solid var(--steel);
  background: var(--graphite);
  font-size: 14px;
  font-weight: 600;
}
.banner + .banner { padding-top: 10px; }
.banner-warn { background: #2b1c10; border-color: var(--change); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + var(--safe-b) + 14px);
  z-index: 40;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--chalk);
  color: #000;
  font-weight: 700;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast:empty { display: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body[data-screen="trening"] .toast, body[data-screen="podsumowanie"] .toast { bottom: calc(var(--safe-b) + 104px); }
body[data-screen="podsumowanie"] .sticky-actions { bottom: calc(var(--safe-b) + 8px); }
body[data-libbar] .toast { bottom: calc(var(--tab-h) + var(--safe-b) + 92px); }
@media (min-width: 900px) {
  .toast { bottom: 28px; }
  .sticky-actions { bottom: calc(var(--safe-b) + 8px); }
  body[data-libbar] .toast { bottom: 104px; }
}

/* ---------------------------------------------------------------- dziś */

.today-date { margin: 4px 0 20px; color: var(--dust-2); font-size: 15px; font-weight: 600; }
.today-date::first-letter { text-transform: uppercase; }
.next { margin: 0 0 30px; }
.next-label { margin: 0 0 6px; color: var(--dust); font-size: 14px; font-weight: 700; }
.next-code { margin: 0; font-size: clamp(104px, 33vw, 210px); }
.next-name { margin: 10px 0 18px; font-size: 23px; font-weight: 800; line-height: 1.15; }
.next-note { margin: -6px 0 18px; padding-left: 12px; border-left: 3px solid var(--chalk); color: var(--dust-2); font-size: 15px; line-height: 1.45; }
.next-facts { display: flex; flex-wrap: wrap; gap: 10px 30px; margin: 0 0 18px; }
.next-facts dt { color: var(--dust); font-size: 13px; font-weight: 600; }
.next-facts dd { margin: 2px 0 0; font-size: 17px; font-weight: 800; }
.next-list { list-style: none; margin: 0 0 22px; padding: 0; border-top: 1px solid var(--steel); }
.next-list li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--steel); font-size: 15px; }
.next-list li span:first-child { font-weight: 600; }
.next-list li span:last-child { text-align: right; white-space: nowrap; }
.next-actions { display: grid; gap: 10px; margin: 0 0 22px; }
.next-actions .button-big { width: 100%; }

.week { margin: 8px 0 0; }
.week-days { list-style: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 0 0 10px; padding: 0; }
.week-days li {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 10px 0 12px;
  border-radius: 12px;
  background: var(--graphite);
  color: var(--dust);
  font-size: 12px;
  font-weight: 700;
}
.week-days li i { width: 12px; height: 12px; border: 2px solid var(--steel-2); border-radius: 50%; }
.week-days li.done { color: var(--chalk); }
.week-days li.done i { background: var(--chalk); border-color: var(--chalk); }
.week-days li.partial i { border-color: var(--chalk); }
.week-days li.today { box-shadow: inset 0 0 0 1px var(--dust); color: var(--chalk); }
/* Dzień z Mojego tygodnia: kropka obrysowana kredą (zrobiony dzień i tak jest wypełniony). */
.week-days li.planned { color: var(--dust-2); }
.week-days li.planned i { border-color: var(--chalk); }
.week p { margin: 0; font-size: 14px; }

.abs { margin: 22px 0 0; padding: 18px; border-radius: var(--r-l); background: var(--graphite); }
.abs p { margin: 0 0 12px; font-weight: 700; }
.abs:not(.ready) p { color: var(--dust-2); }
.abs-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------------------------------------------------------- plany */

.screen-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 16px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 16px; }
.plan-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--steel); }
.plan-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 14px;
  padding: 16px 0 15px;
  border-bottom: 1px solid var(--steel);
  text-decoration: none;
}
.plan-row:active { background: var(--graphite); }
.plan-code { grid-column: 1 / -1; font-size: clamp(42px, 12vw, 58px); }
.plan-name { display: block; font-weight: 800; font-size: 17px; }
.plan-facts { display: block; color: var(--dust); font-size: 14px; }
.plan-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: end; align-self: end; }
@media (min-width: 640px) {
  .plan-row { grid-template-columns: minmax(200px, 38%) 1fr auto; align-items: center; }
  .plan-code { grid-column: auto; }
}

.plan-hero { margin: 14px 0 0; font-size: clamp(92px, 27vw, 176px); }
.plan-title { margin: 10px 0 12px; font-size: 23px; font-weight: 800; line-height: 1.15; }
.ex-list ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--steel); }
.ex-row { padding: 16px 0; border-bottom: 1px solid var(--steel); }
.ex-head { display: grid; grid-template-columns: 30px 1fr 44px; gap: 10px; align-items: start; }
.ex-head h3 { margin: 0 0 2px; font-size: 17px; line-height: 1.25; }
.ex-head p { margin: 0; font-size: 14px; }
.ex-num { color: var(--dust); font-size: 28px; line-height: 1; }
.ex-values { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0 40px; }
.tempo-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--steel);
  border-radius: var(--r-m);
  background: transparent;
  color: var(--chalk);
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.tempo-button:active { background: var(--steel); }
.tempo-button-label { color: var(--dust-2); font-weight: 700; }
.tempo-button b { font-weight: 800; }
.tempo-own { border-color: var(--steel-2); }
.tempo-own-tag { padding: 2px 7px; border-radius: 999px; background: var(--chalk); color: var(--black); font-size: 12px; font-weight: 800; }

.tempo-intro { margin: 0 0 10px; color: var(--dust-2); }
.tempo-code { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 6px; }
.tempo-code b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tempo-code span { color: var(--dust); font-size: 14px; }
.tempo-parts { display: grid; }
.tempo-part { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--steel); }
.tempo-part:last-child { border-bottom: 0; }
.tempo-part-text p { margin: 0; }
.tempo-part-name { font-weight: 800; }
.tempo-cue { color: var(--dust); font-weight: 400; }
.tempo-part-hint { color: var(--dust-2); font-size: 14px; line-height: 1.35; }
.tempo-part .stepper { grid-template-columns: 46px 56px 46px; }
.tempo-locked { color: var(--dust-2); font-weight: 700; white-space: nowrap; }
.tempo-total { margin: 14px 0 6px; font-variant-numeric: tabular-nums; }
.tempo-advice { margin: 0 0 8px; padding: 10px 12px; border-left: 3px solid var(--signal); background: var(--black); border-radius: 0 var(--r-s) var(--r-s) 0; color: var(--dust-2); font-size: 14px; }
.fold { border-top: 1px solid var(--steel); padding: 16px 0; }
.fold:last-of-type { border-bottom: 1px solid var(--steel); }
.fold summary { cursor: pointer; font-weight: 800; }
.notes { margin: 12px 0 0; padding-left: 18px; color: var(--dust-2); }
.notes li { margin: 0 0 8px; }
.timeline { list-style: none; margin: 12px 0 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--graphite-2); font-size: 14px; font-variant-numeric: tabular-nums; color: var(--dust-2); }
.timeline time { color: var(--dust); }
.timeline .tl-work { color: var(--chalk); font-weight: 600; }
.plan-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 0; }

/* ---------------------------------------------------------------- edytor */

.ed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.ed-plan { margin: 0 0 14px; }
.ed-items { list-style: none; margin: 0 0 16px; padding: 0; }
.ed-item { padding: 16px 0; border-top: 1px solid var(--steel); }
.ed-item-head { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: start; margin: 0 0 12px; }
.ed-item-head h3 { margin: 0; font-size: 17px; }
.ed-item-head p { margin: 2px 0 0; font-size: 14px; }
.ed-item-tools { display: flex; }
.search { margin: 6px 0 12px; }
.picker section { margin: 0 0 6px; }
.picker ul { list-style: none; margin: 0; padding: 0; }
.picker-row {
  width: 100%;
  min-height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 2px;
  border: 0;
  border-bottom: 1px solid var(--steel);
  background: none;
  color: var(--chalk);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.picker-row .muted { font-weight: 500; font-size: 13px; text-align: right; }
.import-list, .error-list { margin: 8px 0; padding-left: 20px; color: var(--dust-2); }

/* ---------------------------------------------------------------- historia i podsumowanie */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 0 0 22px; }
.stats div { padding: 12px 14px 14px; border-radius: var(--r-m); background: var(--graphite); }
.stats dt { color: var(--dust); font-size: 13px; font-weight: 600; }
.stats dd { margin: 6px 0 0; font-size: 46px; }
.stats small { font-stretch: 100%; font-size: 17px; font-weight: 700; color: var(--dust-2); letter-spacing: 0; }
.stats .dd-text { font-stretch: 100%; font-size: 20px; font-weight: 800; padding-top: 12px; letter-spacing: 0; }
.hist-week { margin: 0 0 8px; }
.hist-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--steel); }
.hist-row { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--steel); text-decoration: none; }
.hist-date { display: grid; justify-items: center; }
.hist-date b { font-size: 36px; }
.hist-date small { color: var(--dust); font-size: 12px; font-weight: 700; }
.hist-title { display: block; font-weight: 800; }
.hist-text .muted { display: block; font-size: 14px; }
.history-detail .screen-title { font-size: clamp(34px, 9vw, 54px); line-height: 0.92; }
.hist-ex { list-style: none; margin: 0 0 22px; padding: 0; }
.hist-ex > li { padding: 14px 0; border-top: 1px solid var(--steel); }
.hist-ex-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hist-ex h3 { margin: 0; font-size: 17px; }
.hist-ex p { margin: 6px 0 0; }
.ex-history { list-style: none; margin: 0; padding: 0; }
.ex-history > li { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--steel); }
.ex-history > li:last-child { border-bottom: 0; }
/* W panelach (tło grafitowe) kafelki serii muszą odcinać się od tła. */
.panel .set-chip { background: var(--graphite-2); }

.set-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; }
.set-chip { display: grid; padding: 6px 11px; border-radius: 10px; background: var(--graphite); font-weight: 800; font-variant-numeric: tabular-nums; }
.set-chip small { color: var(--dust-2); font-size: 11px; font-weight: 600; }
.set-chip.hard { box-shadow: inset 0 0 0 1px var(--change); }
.set-chip.easy { box-shadow: inset 0 0 0 1px var(--rest); }
.set-chip.skipped { color: var(--dust); background: repeating-linear-gradient(45deg, var(--graphite) 0 5px, var(--black) 5px 10px); font-weight: 600; }

.eyebrow-code { margin: 8px 0 0; color: var(--dust); font-size: 30px; }
.sum-item { padding: 16px 0; border-top: 1px solid var(--steel); }
.sum-item header h3 { margin: 0; font-size: 18px; }
.sum-item header p { margin: 2px 0 0; font-size: 14px; }
.sum-rate-row { margin: 12px 0 0; }
.sum-rate-row .wk-label { margin: 0 0 6px; }
.sum-rate { margin: 0; }
.sum-rate-hint { margin: -6px 0 14px; color: var(--dust); font-size: 13px; line-height: 1.4; max-width: 60ch; }
.sum-next { margin: 12px 0 0; padding: 14px; border-radius: var(--r-m); background: var(--graphite); }
.sum-steppers { display: flex; flex-wrap: wrap; gap: 10px; }
.sum-steppers .stepper { background: var(--black); }
.sum-reason { margin: 10px 0 0; color: var(--dust-2); font-size: 14px; }
.sum-untouched { margin: 0; padding: 16px 0; border-top: 1px solid var(--steel); color: var(--dust-2); }
.next-list + .button { margin-top: 0; }

.panel { display: grid; gap: 12px; margin: 0 0 16px; padding: 18px; border-radius: var(--r-l); background: var(--graphite); }
.panel .group-title { margin: 0; }
.panel .button { justify-self: start; }
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 6px 0; cursor: pointer; }
.toggle-label { display: block; font-weight: 700; }
.toggle input {
  appearance: none;
  position: relative;
  flex: none;
  width: 54px;
  height: 32px;
  margin: 0;
  border-radius: 999px;
  background: var(--steel-2);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.toggle input::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--dust-2);
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.toggle input:checked { background: var(--chalk); }
.toggle input:checked::after { transform: translateX(22px); background: #000; }
.failed { list-style: none; margin: 8px 0 0; padding: 0; }
.failed li { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid var(--steel); }

/* ---------------------------------------------------------------- logowanie */

.login { max-width: 440px; margin: 0 auto; padding: calc(9vh + var(--safe-t)) var(--pad) 48px; }
/* Dłuższy wiersz znaku (QUAKE z marginesem tła) ma ok. 2,55 em: ten rozmiar mieści go w ekranie od 280 px szerokości. */
.login-mark { display: grid; margin: 0 0 30px; font-size: clamp(96px, 34vw, 148px); line-height: 0.8; letter-spacing: -0.02em; }
.login-mark span:last-child { width: fit-content; padding: 0.02em 0.05em 0; background: var(--signal); color: #000; }
.login-title { margin: 0 0 6px; font-size: 30px; font-weight: 800; }

/* ---------------------------------------------------------------- okna */

.dialog { max-width: 100vw; max-height: 100dvh; padding: 0; border: 0; background: transparent; color: var(--chalk); }
.dialog::backdrop { background: rgba(0, 0, 0, 0.72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dialog-confirm {
  width: min(460px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--steel);
  border-radius: var(--r-l);
  background: var(--graphite);
}
.dialog-sheet {
  position: fixed;
  inset: auto 0 0 0;
  width: min(720px, 100vw);
  max-height: 88dvh;
  margin: 0 auto;
  padding: 18px var(--pad) calc(24px + var(--safe-b));
  overflow-y: auto;
  border-radius: 26px 26px 0 0;
  background: var(--graphite);
}
.dialog-tall { height: 88dvh; }
.dialog-title { margin: 0; font-size: 27px; font-stretch: 75%; font-weight: 800; line-height: 1.05; }
.dialog-text { color: var(--dust-2); }
.dialog-actions { display: grid; gap: 10px; margin: 20px 0 0; }
.sheet-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin: 0 0 14px; }
.sheet-kicker { margin: 0 0 4px; color: var(--dust); font-size: 14px; font-weight: 700; }
.sheet-rows { display: grid; gap: 12px; }
.sheet-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; }
.sheet-row select { width: auto; max-width: 100%; }
.sheet-links { display: grid; gap: 10px; margin: 18px 0 0; }
.technique h3 { margin: 18px 0 6px; font-size: 15px; color: var(--dust); }
.technique p { margin: 0; }
.technique-steps { margin: 0; padding-left: 20px; }
.technique-steps li { margin: 0 0 6px; }
.technique-tip { margin-top: 12px !important; color: var(--dust-2); }
.technique-mistake { margin-top: 12px !important; padding: 12px 14px; border-left: 3px solid var(--change); background: var(--black); border-radius: 0 var(--r-s) var(--r-s) 0; }

/* ---------------------------------------------------------------- trening */

body[data-screen="trening"] { overflow: hidden; }
body[data-screen="trening"] .banners { position: fixed; inset: auto 0 calc(var(--safe-b) + 92px) 0; }
.workout {
  --tone: var(--signal);
  --ink: #000;
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: var(--safe-t) 0 var(--safe-b);
  background: var(--black);
}
.workout[data-tone="rest"] { --tone: var(--rest); }
.workout[data-tone="change"] { --tone: var(--change); }
.workout[data-tone="neutral"] { --tone: var(--chalk); }

.wk-top { display: grid; grid-template-columns: 44px 1fr auto 44px; align-items: center; gap: 10px; padding: 6px 8px; }
.wk-progress { display: flex; gap: 3px; height: 6px; }
.wk-progress i { flex: 1; border-radius: 2px; background: var(--steel); }
.wk-progress i.done { background: var(--dust-2); }
.wk-progress i.current { background: var(--tone); }
.wk-progress i.skipped { background: repeating-linear-gradient(45deg, var(--steel-2) 0 2px, transparent 2px 4px); }
.wk-remaining { color: var(--dust-2); font-weight: 800; font-variant-numeric: tabular-nums; }

.wk-stage { --level: 1; position: relative; flex: 1; min-height: 0; overflow: hidden; }
.wk-tide {
  position: absolute;
  inset: 0;
  background: var(--tone);
  transform: scaleY(var(--level));
  transform-origin: 50% 100%;
  will-change: transform;
}
/* Zmiana talerzy: taśma ostrzegawcza na krawędzi „przypływu”. */
.workout[data-tone="change"] .wk-tide::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 18px;
  background: repeating-linear-gradient(-45deg, #000 0 12px, var(--change) 12px 24px);
  transform: scaleY(calc(1 / max(var(--level), 0.02)));
  transform-origin: 50% 0;
}
.wk-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--pad);
  color: var(--chalk);
}
.wk-face-ink { color: var(--ink); clip-path: inset(calc((1 - var(--level)) * 100%) 0 0 0); pointer-events: none; }
/* Napis nad liczbą nie może wchodzić na taśmę ostrzegawczą; liczba może być tu mniejsza niż w serii. */
.workout[data-tone="change"] .wk-face { padding-top: 28px; }
.workout[data-tone="change"] .wk-big-main { font-size: clamp(110px, 36vw, 280px); }
.wk-kicker { margin: 0; font-size: 18px; font-weight: 800; }
.wk-title { max-width: 24ch; margin: 4px 0 0; font-size: clamp(22px, 6.2vw, 36px); font-weight: 800; line-height: 1.08; }
.wk-big { display: flex; align-items: baseline; margin: 3vh 0 1.5vh; }
.wk-big-main { font-size: clamp(150px, 48vw, 360px); line-height: 0.78; }
.wk-big-sub { margin-left: 0.04em; font-size: clamp(46px, 14vw, 110px); font-weight: 800; opacity: 0.62; }
.wk-wide .wk-big-main { font-size: clamp(84px, 24vw, 190px); }
.wk-cue { margin: 0; font-size: clamp(21px, 5.6vw, 32px); font-weight: 800; line-height: 1.15; }
.wk-cue-time { font-variant-numeric: tabular-nums; opacity: 0.7; }
.wk-meta { min-height: 1.4em; margin: 8px 0 0; font-size: 18px; font-weight: 800; }
.wk-meta:empty::before { content: '\200b'; }

.wk-stage::after {
  content: 'Pauza';
  position: absolute;
  top: 12px;
  right: var(--pad);
  padding: 5px 12px;
  border-radius: 999px;
  background: #000;
  color: var(--chalk);
  font-size: 14px;
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.workout[data-state="paused"] .wk-stage::after { opacity: 1; }

.wk-motion { position: absolute; inset: 10px 10px auto; z-index: 2; height: 54%; }
/* Dolna krawędź pokazu = zmierzona wysokość napisów etapu (js/ui/workout.js, fitMotion). */
.workout.has-motion .wk-motion { inset: 10px 10px var(--motion-bottom, 46%); height: auto; }
.workout.has-motion .wk-face { justify-content: flex-end; padding-bottom: 14px; }
.workout.has-motion .wk-big { margin: 1vh 0 0.5vh; }
.workout.has-motion .wk-big-main { font-size: clamp(70px, 20vw, 140px); }
/* Przerwa przed serią: u góry pokaz ruchu następnego ćwiczenia (jego nazwa jest w nagłówku pokazu),
   pod nim polecenie, odliczanie i ciężar. Wysokość pokazu zależy od miejsca nad odliczaniem. */
/* Nazwa ćwiczenia jest w nagłówku pokazu 3D, więc pod nim zostają tylko seria, odliczanie i polecenie. */
.workout.has-motion .wk-title { display: none; }
.workout.has-motion-next .wk-face { padding-top: 0; padding-bottom: 10px; }
.workout.has-motion-next .wk-kicker { font-size: 15px; }
.workout.has-motion-next .wk-big { margin: 0; }
.workout.has-motion-next .wk-big-main, .workout.has-motion-next[data-tone="change"] .wk-big-main { font-size: clamp(48px, 14vw, 96px); }
.workout.has-motion-next .wk-meta { margin-top: 2px; font-size: 15px; }
.wk-motion .motion3d-tempo { display: none; }
/* Mało miejsca nad napisami: mniejsze odliczanie i polecenie, żeby pokaz był czytelny. */
.workout.has-motion.motion-compact .wk-kicker { font-size: 14px; }
.workout.has-motion.motion-compact .wk-big { margin: 0; }
.workout.has-motion.motion-compact .wk-big-main { font-size: 46px; }
.workout.has-motion.motion-compact .wk-big-sub { font-size: 24px; }
.workout.has-motion.motion-compact .wk-cue { font-size: 17px; }
.workout.has-motion.motion-compact .wk-meta { min-height: 0; margin-top: 2px; font-size: 14px; }
.wk-motion { container-type: size; }
.wk-motion .motion3d-viewport { min-height: 70px; }
/* Bardzo niski panel (mały telefon): cała wysokość dla animacji, opis fazy jest pod panelem. */
@container (max-height: 175px) {
  .wk-motion .motion3d-caption { display: none; }
}
@container (max-height: 250px) {
  .wk-motion .motion3d-hint { display: none; }
  .wk-motion .motion3d-top { padding-top: 8px; }
  .wk-motion .motion3d-caption { padding-bottom: 6px; }
}

.wk-bar { display: none; height: 4px; background: var(--steel); }
.wk-bar i { display: block; height: 100%; background: var(--tone); transform-origin: 0 50%; }
.wk-panel { display: grid; gap: 12px; max-height: 40dvh; overflow-y: auto; padding: 12px var(--pad) 4px; background: var(--black); }
.wk-panel:empty { display: none; }
.wk-label { margin: 0 0 6px; color: var(--dust-2); font-size: 14px; font-weight: 700; }
.wk-hint { margin: 0; color: var(--dust-2); font-size: 15px; }
.wk-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.wk-tools .button { min-height: 44px; padding: 0 14px; }
.wk-suggest { width: 100%; border-color: var(--chalk); }
.wk-rate-hint { margin: 8px 0 0; color: var(--dust); font-size: 13px; line-height: 1.4; }
/* Seria zakończona przyciskiem przed czasem: liczba powtórzeń wymaga sprawdzenia. */
.wk-log.early { padding: 10px 12px 12px; border-radius: var(--r-m); box-shadow: inset 0 0 0 1px var(--change); }
.wk-early { margin: -2px 0 8px; color: var(--chalk); font-size: 14px; font-weight: 700; }
.voice-settings { display: grid; gap: 12px; margin: 4px 0 6px; padding: 12px 0 4px; border-top: 1px solid var(--steel); }
.voice-settings .button { justify-self: start; }
.wk-controls { display: grid; grid-template-columns: 58px 58px 1fr; gap: 10px; padding: 10px var(--pad) 14px; background: var(--black); }
.wk-controls .wk-small { min-height: 62px; padding: 0; }
.wk-primary { min-height: 62px; font-size: 18px; background: var(--tone); color: #000; }
.workout[data-state="waiting"] .wk-controls { grid-template-columns: 58px 1fr; }

@media (orientation: landscape) and (max-height: 560px) {
  .workout { flex-direction: row; flex-wrap: wrap; }
  .wk-top { width: 100%; }
  .wk-stage { flex: 1 1 55%; height: calc(100dvh - 60px); }
  .wk-bar { display: none; }
  .wk-panel, .wk-controls { flex: 1 1 40%; }
  .wk-big-main { font-size: 34vh; }
}
@media (min-width: 900px) {
  .wk-face { padding: 0 max(var(--pad), calc((100vw - 900px) / 2)); }
  .wk-panel, .wk-controls { padding-left: max(var(--pad), calc((100vw - 900px) / 2)); padding-right: max(var(--pad), calc((100vw - 900px) / 2)); }
}

/* Demonstracja 3D (moduł js/motion/animation3d.js). */
.motion3d-host { min-width: 0; font-size: 13px; }
.motion3d-host.hidden { display: none; }
.motion3d-panel { overflow: hidden; height: 100%; display: flex; flex-direction: column; border: 1px solid var(--steel); border-radius: 18px; background: var(--graphite); color: var(--chalk); }
.motion3d-top { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px 0; font-size: 12px; font-weight: 700; color: var(--dust-2); }
.motion3d-viewport { flex: 1; min-height: 160px; width: 100%; touch-action: pan-y; cursor: grab; }
.motion3d-viewport canvas { display: block; width: 100%; height: 100%; }
.motion3d-panel[data-source="clip"] .motion3d-viewport { position: relative; overflow: hidden; cursor: default; }
.motion3d-viewport video, .motion3d-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--graphite); pointer-events: none; -webkit-user-select: none; user-select: none; }
.motion3d-viewport video::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }
.motion3d-caption { display: grid; gap: 2px; padding: 4px 14px 8px; }
.motion3d-caption p { margin: 0; }
.motion3d-top span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.motion3d-state { flex: none; }
.motion3d-line { font-size: 15px; }
.motion3d-cue { color: var(--chalk); font-weight: 800; }
.motion3d-time { margin-left: 6px; color: var(--signal); font-weight: 800; font-variant-numeric: tabular-nums; }
.motion3d-hint { color: var(--dust-2); }
.motion3d-side { color: var(--signal); font-weight: 700; }
/* Pasek tempa: fazy jednego powtórzenia w proporcji do ich czasu, bieżąca faza wypełnia się na żółto. */
.motion3d-tempo { display: flex; gap: 3px; margin-top: 6px; }
.motion3d-tempo[hidden] { display: none; }
.motion3d-tempo span { position: relative; min-width: 0; overflow: hidden; border-radius: 6px; background: var(--steel); }
.motion3d-tempo i { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(255, 212, 0, 0.32); }
.motion3d-tempo em { position: relative; display: block; padding: 0 6px; overflow: hidden; color: var(--dust-2); font-size: 11px; font-style: normal; font-weight: 700; line-height: 22px; white-space: nowrap; text-overflow: ellipsis; }
.motion3d-tempo .on em { color: var(--chalk); }
.motion3d-panel[data-mode="workout"] .motion3d-tempo { display: none; }
.motion3d-controls { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
.motion3d-controls button { min-height: 36px; padding: 0 12px; border: 1px solid var(--steel-2); border-radius: 999px; background: transparent; color: var(--chalk); font-weight: 700; cursor: pointer; }
.motion3d-controls button[aria-pressed="true"] { background: var(--chalk); color: #000; }
.motion3d-note { margin: 0; padding: 0 14px 12px; color: var(--dust); font-size: 12px; }
.motion3d-fallback { margin: 0; padding: 16px; color: var(--dust-2); }
.dialog .motion3d-host { height: min(560px, 72dvh); margin: 0 0 8px; }
.wk-motion .motion3d-note, .wk-motion .motion3d-controls { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .wk-bar { display: block; }
}

/* ---------------------------------------------------------------- postępy */

.range { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.range .chip { min-height: 40px; }
.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpis dd { font-variant-numeric: normal; }
.kpi-note { margin: 6px 0 0; color: var(--dust-2); font-size: 13px; line-height: 1.35; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Kalendarz: kolumny to tygodnie, wiersze dni od poniedziałku. */
.cal-wrap { display: grid; grid-template-columns: auto 1fr; gap: 6px; align-items: start; }
.cal-days { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; height: 100%; color: var(--dust); font-size: 10px; font-weight: 700; line-height: 1; }
.cal-days span { display: flex; align-items: center; }
.cal { display: grid; grid-template-columns: repeat(var(--weeks), minmax(0, 22px)); gap: 3px; }
.cal-week { display: grid; grid-template-rows: repeat(7, auto); gap: 3px; }
.cal-day { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 4px; background: var(--steel); }
.cal-day.out { background: transparent; box-shadow: inset 0 0 0 1px var(--graphite-2); }
.cal-day.on { background: var(--chalk); cursor: pointer; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--dust); }
.cal-day.on.selected, .cal-day.on:focus-visible { outline: 2px solid var(--chalk); outline-offset: 2px; }
.cal-caption { margin: 10px 0 0; color: var(--dust-2); font-size: 14px; }

/* Lista ćwiczeń z trendem. */
.pr-list { list-style: none; margin: 0; padding: 0; display: grid; }
.pr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name spark" "trend trend"; gap: 6px 12px; padding: 12px 0; border-top: 1px solid var(--steel); color: inherit; text-decoration: none; }
.pr-list li:first-child .pr-row { border-top: 0; }
.pr-name { grid-area: name; display: grid; gap: 2px; min-width: 0; }
.pr-name b { font-weight: 800; overflow-wrap: anywhere; }
.pr-name small { color: var(--dust-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.pr-spark { grid-area: spark; align-self: center; }
.pr-row .trend { grid-area: trend; justify-self: start; }
@media (min-width: 560px) { .pr-row { grid-template-columns: minmax(0, 1fr) auto 190px; grid-template-areas: "name spark trend"; align-items: center; } .pr-row .trend { justify-self: end; } }
.spark-line { fill: none; stroke: var(--dust); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--chalk); }

/* Znaczek trendu: strzałka w kolorze stanu, słowo zawsze w kolorze tekstu. */
.trend { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px; background: var(--graphite-2); color: var(--chalk); font-size: 13px; font-weight: 700; white-space: nowrap; }
.trend .icon { width: 18px; height: 18px; }
.trend-up .icon { color: #3ecf7a; }
.trend-down .icon { color: var(--danger); }
.trend-flat .icon { color: var(--dust); }
.trend-few { color: var(--dust-2); padding-left: 10px; }

/* Serie na mięśnie: poziome słupki od wspólnej osi, wartość przy końcu. */
.bars { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(92px, 34%) 1fr 36px; align-items: center; gap: 10px; }
.bar-name { color: var(--dust-2); font-size: 14px; font-weight: 600; }
.bar-track { height: 12px; }
.bar-track i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--chalk); }
.bar-value { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }

/* Ekran ćwiczenia. */
.pr-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: -4px 0 10px; }
.pr-insight { margin-bottom: 16px; }
.chart-panel .muted.small { margin: -2px 0 10px; }
.pr-records { display: grid; gap: 10px; margin: 0; }
.pr-records div { display: flex; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid var(--steel); }
.pr-records div:first-child { border-top: 0; padding-top: 0; }
.pr-records dt { color: var(--dust-2); }
.pr-records dd { margin: 0; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.pr-records dd small { display: block; color: var(--dust); font-size: 12px; font-weight: 600; }

/* Wykres liniowy (js/ui/charts.js). */
.chart { position: relative; min-height: 120px; outline: none; touch-action: pan-y; }
.chart:focus-visible { box-shadow: 0 0 0 2px var(--chalk); border-radius: 6px; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--steel); stroke-width: 1; }
.chart-tick { fill: var(--dust); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-band { fill: var(--chalk); opacity: 0.07; }
.chart-band-label { fill: var(--dust); font-size: 10px; font-weight: 600; }
.chart-mark { stroke: var(--dust); stroke-width: 1; opacity: 0.6; }
.chart-mark-label { fill: var(--dust); font-size: 10px; }
.chart-line { fill: none; stroke: var(--chalk); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: var(--chalk); stroke: var(--graphite); stroke-width: 2; }
.chart-dot.tone-hard { fill: var(--change); }
.chart-dot.tone-easy { fill: var(--rest); }
.chart-dot.hollow { fill: var(--graphite); stroke: var(--chalk); stroke-width: 1.5; }
.chart-record { fill: none; stroke: var(--chalk); stroke-width: 1.5; }
.chart-end { fill: var(--chalk); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.chart-cross { stroke: var(--dust-2); stroke-width: 1; }
.chart-focus { fill: none; stroke: var(--chalk); stroke-width: 2; }
.chart-hit { fill: transparent; cursor: crosshair; }
.chart-tip { position: absolute; z-index: 3; display: grid; gap: 1px; max-width: 240px; padding: 8px 10px; border: 1px solid var(--steel-2); border-radius: var(--r-s); background: var(--black); color: var(--dust-2); font-size: 12px; line-height: 1.35; pointer-events: none; }
.chart-tip strong { color: var(--chalk); font-size: 15px; font-weight: 800; }
.chart-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; padding: 0; color: var(--dust-2); font-size: 12px; }
.chart-legend li { display: flex; align-items: center; gap: 6px; }
.chart-legend .key { width: 10px; height: 10px; border-radius: 50%; background: var(--chalk); }
.chart-legend .key.tone-hard { background: var(--change); }
.chart-legend .key.tone-easy { background: var(--rest); }
.chart-legend .key.record { background: transparent; box-shadow: 0 0 0 1.5px var(--chalk); width: 14px; height: 14px; }
.chart-legend .key.hollow { background: transparent; box-shadow: inset 0 0 0 1.5px var(--chalk); }

/* Podsumowanie: nowe rekordy i porównanie z poprzednim treningiem. */
.sum-records ul { list-style: none; display: grid; gap: 10px; margin: 0; padding: 0; }
.sum-records li { display: grid; gap: 2px; }
.sum-records li span { color: var(--dust-2); }
.sum-vs { margin: 8px 0 0; color: var(--dust-2); font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- biblioteka */

/* Ekran startowy: wyszukiwarka, linia filtrów i lista kategorii. Kategoria: grupy sprzętu, w każdej od najłatwiejszego. */
/* Przycisk trenera stoi nad zakładkami; lista dostaje pod sobą tyle miejsca, żeby nie zasłaniał ostatniego wiersza. */
.library { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 104px); }
.library-category .screen-title { margin-top: 14px; }
.screen-title-long { font-size: clamp(40px, 10.5vw, 68px); }
.lib-search { position: relative; display: block; margin: 4px 0 10px; }
.lib-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--dust); pointer-events: none; }
.lib-search input { padding-left: 46px; min-height: 52px; border-radius: var(--r-m); background: var(--graphite); border-color: var(--steel); }

/* Linia filtrów: co teraz widać (sprzęt, poziom) i „Zmień”, które otwiera okno filtrów. */
.lib-filter-line {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 9px 14px;
  border: 0;
  border-radius: var(--r-m);
  background: var(--graphite);
  color: var(--chalk);
  text-align: left;
  cursor: pointer;
}
.lib-filter-icon .icon { width: 26px; height: 26px; stroke-width: 1.7; }
.lib-filter-text { display: grid; gap: 1px; min-width: 0; }
.lib-filter-main { font-weight: 800; line-height: 1.25; }
.lib-filter-level { font-weight: 600; color: var(--dust-2); }
.lib-filter-note { overflow: hidden; color: var(--dust); font-size: 13px; font-weight: 600; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.lib-filter-change { color: var(--dust-2); font-size: 15px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.lib-filter-line:active { transform: scale(0.99); }

/* Kategorie: duże wiersze z liczbą ćwiczeń przy obecnych filtrach. */
.lib-cats { list-style: none; margin: 20px 0 0; padding: 0; border-top: 1px solid var(--steel); }
.lib-cat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 22px;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  border-bottom: 1px solid var(--steel);
  color: var(--chalk);
  text-decoration: none;
}
.lib-cat-name { font-size: 24px; font-weight: 800; font-stretch: 75%; line-height: 1.1; }
.lib-cat-n { color: var(--dust-2); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lib-cat .icon { color: var(--dust); }
.lib-cat:active { background: var(--graphite); }
.lib-cat-empty { color: var(--steel-2); }
.lib-cat-empty .lib-cat-n { color: var(--steel-2); }

.lib-count-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 18px 0 0; }
.lib-count { margin: 18px 0 0; color: var(--dust-2); font-variant-numeric: tabular-nums; }
.lib-count-row .lib-count { margin: 0; }
.lib-count strong { color: var(--chalk); }
.lib-count-row .link-button { font-size: 15px; font-weight: 700; color: var(--chalk); }

/* Grupa sprzętu (albo kategoria w wynikach wyszukiwania): piktogram, nazwa, liczba. */
.lib-section { margin: 26px 0 0; }
.lib-section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 19px; font-weight: 800; line-height: 1.2; }
.lib-section-title .icon { width: 26px; height: 26px; stroke-width: 1.7; }
.lib-section-n { margin-left: auto; color: var(--dust); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lib-list { list-style: none; margin: 0; padding: 0; }
.lib-row { display: grid; grid-template-columns: minmax(0, 1fr) 22px; align-items: center; gap: 10px; border-top: 1px solid var(--steel); }
.lib-row.with-pick { grid-template-columns: minmax(0, 1fr) 44px; }
.lib-open { display: grid; gap: 3px; min-width: 0; padding: 13px 0 14px; border: 0; background: none; color: var(--chalk); text-align: left; cursor: pointer; }
.lib-name { font-size: 17px; font-weight: 800; line-height: 1.25; }
.lib-sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-width: 0; color: var(--dust-2); font-size: 14px; line-height: 1.3; }
.lib-gear-tag { padding: 1px 7px; border-radius: 6px; background: var(--steel); color: var(--chalk); font-size: 13px; font-weight: 700; }
/* Poziom słowem pod nazwą; trudniejsze jaśniej, żeby od razu było widać, gdzie zaczyna się wyzwanie. */
.lib-level { color: var(--dust); font-size: 13px; font-weight: 700; white-space: nowrap; }
.lib-level.lvl-2 { color: var(--dust-2); }
.lib-level.lvl-3 { color: var(--chalk); }
.lib-chevron { display: grid; place-items: center; color: var(--steel-2); }
.lib-chevron .icon { width: 20px; height: 20px; }
.lib-pick { width: 44px; height: 44px; display: grid; place-items: center; justify-self: end; padding: 0; border: 0; background: none; color: #000; cursor: pointer; }
.lib-pick span { width: 26px; height: 26px; display: grid; place-items: center; border: 2px solid var(--dust); border-radius: 7px; }
.lib-pick .icon { width: 18px; height: 18px; stroke-width: 3; }
.lib-row.selected .lib-pick span { background: var(--chalk); border-color: var(--chalk); }
.lib-pick:active span { transform: scale(0.9); }
.lib-empty { display: grid; gap: 12px; justify-items: start; padding: 24px 0; color: var(--dust-2); }
.lib-empty p { margin: 0; }

/* Okno „Sprzęt i poziom”. */
.lf-title { margin: 22px 0 6px; color: var(--dust); font-size: 14px; font-weight: 700; }
.lf-list { list-style: none; margin: 0; padding: 0; }
.lf-row {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 26px;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--steel);
  background: none;
  color: var(--chalk);
  text-align: left;
  cursor: pointer;
}
.lf-row .icon { width: 26px; height: 26px; stroke-width: 1.7; }
.lf-text { display: grid; gap: 1px; min-width: 0; }
.lf-label { font-weight: 800; }
.lf-note { color: var(--dust); font-size: 13px; line-height: 1.3; }
.lf-n { color: var(--dust); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lf-mark { grid-column: 4; width: 24px; height: 24px; display: grid; place-items: center; border: 2px solid var(--dust); color: #000; }
.lf-mark.radio { border-radius: 999px; }
.lf-mark.check { border-radius: 7px; }
.lf-mark .icon { width: 16px; height: 16px; stroke-width: 3; }
.lf-row[aria-pressed="true"] .lf-mark { background: var(--chalk); border-color: var(--chalk); }
.lf-hint { margin: 10px 0 0; color: var(--dust-2); font-size: 14px; }
.lf-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 24px 0 0; position: sticky; bottom: 0; padding: 10px 0 2px; background: var(--graphite); }
.segs { display: flex; flex-wrap: wrap; gap: 6px; }
.seg { min-height: 40px; padding: 0 14px; border: 0; border-radius: var(--r-s); background: var(--steel); color: var(--chalk); font-size: 14px; font-weight: 700; cursor: pointer; }
.seg.selected { background: var(--chalk); color: #000; }
/* Pasek wybranych ćwiczeń stoi nad paskiem zakładek; lista dostaje miejsce, żeby ostatni wiersz nie chował się pod nim. */
.lib-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tab-h) + var(--safe-b));
  z-index: 15;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px var(--pad);
  background: var(--graphite);
  border-top: 1px solid var(--steel-2);
}
.lib-bar p { margin: 0; min-width: 0; color: var(--dust-2); }
.lib-bar strong { color: var(--chalk); }
.lib-bar .link-button { margin-left: 6px; font-size: 14px; color: var(--dust-2); }
.lib-bar .button { flex: none; min-height: 46px; padding: 0 16px; }
body[data-libbar] .library { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 180px); }
@media (min-width: 900px) {
  .lib-bar { bottom: 24px; left: 50%; right: auto; width: min(var(--max), calc(100vw - 48px)); transform: translateX(-50%); border: 1px solid var(--steel-2); border-radius: var(--r-l); }
  body[data-libbar] .library { padding-bottom: 140px; }
}
.lib-chooser-names { margin: -4px 0 16px; }
.lib-chooser-hint { margin: 8px 0 0; }
.lib-plans { list-style: none; margin: 0; padding: 0; }
.lib-plans .picker-row span { display: grid; gap: 2px; }
.lib-plans .picker-row small { font-weight: 500; font-size: 13px; }

/* Karta ćwiczenia: opis z biblioteki nad techniką (w treningu zwinięty pod techniką). */
.ex-about { margin: 0 0 6px; }
.ex-purpose { margin: 0 0 14px; font-size: 17px; line-height: 1.45; }
.ex-facts { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--steel); }
.ex-facts div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--steel); }
.ex-facts dt { color: var(--dust); font-size: 14px; font-weight: 700; }
.ex-facts dd { margin: 0; }
.ex-levels { display: grid; gap: 12px; margin: 18px 0 0; }
.ex-levels div { padding: 12px 14px; border-radius: var(--r-m); background: var(--black); }
.ex-levels h3 { margin: 0 0 4px; font-size: 15px; color: var(--dust); }
.ex-levels p { margin: 0; }
@media (min-width: 560px) { .ex-levels { grid-template-columns: 1fr 1fr; } }
.ex-fold { margin: 18px 0 0; border-top: 1px solid var(--steel); }
.ex-fold summary { padding: 14px 0; font-weight: 800; cursor: pointer; }
.sheet-actions { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; padding: 12px 0 2px; background: linear-gradient(transparent, var(--graphite) 22%); }
.sheet-actions .button { flex: 1 1 auto; white-space: nowrap; }
.sheet-actions .button[aria-pressed="true"] { border-color: var(--chalk); }

/* Edytor: ćwiczenia dopisane z biblioteki są wyróżnione do zapisu. */
.ed-item-new { box-shadow: inset 3px 0 0 var(--chalk); padding-left: 14px; }
.ed-item-new h3 .badge { vertical-align: 2px; margin-left: 6px; }

.chip[disabled] { opacity: 0.7; cursor: default; }

/* ---------------------------------------------------------------- dziś: mój tydzień */

.rest-title, .week-title { margin: 0 0 16px; font-size: clamp(64px, 20vw, 120px); font-stretch: 62%; font-weight: 900; letter-spacing: -0.012em; line-height: 0.86; }
.rest-day { margin: 0 0 26px; }
.rest-day .group-title { margin: 26px 0 10px; }
.rest-hint { margin: 16px 0 0; }
.today-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 0 0 10px; padding: 14px 16px; border-radius: var(--r-l); background: var(--graphite); }
.today-card-text { display: grid; gap: 2px; min-width: 0; color: var(--chalk); text-decoration: none; }
.today-card-text .next-label { margin: 0; }
.today-card-code { font-size: 30px; font-stretch: 62%; font-weight: 900; line-height: 1; }
.today-card .muted { font-size: 14px; }
.today-card .button { min-height: 46px; padding: 0 16px; }
.today-card.done .today-card-code { color: var(--dust-2); }
.today-card-check { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 999px; background: var(--chalk); color: #000; }
.next + .today-card { margin-top: -8px; }
.week-plan { margin: 18px 0 0; padding: 14px 16px; border-radius: var(--r-l); border: 1px solid var(--steel); }
.week-plan ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.week-plan li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; font-weight: 700; }
.week-plan-days { color: var(--dust-2); }
.week-invite, .onboard { margin: 22px 0 0; }
.week-invite { display: grid; gap: 12px; padding: 18px; border-radius: var(--r-l); background: var(--graphite); }
.week-invite p { margin: 0; color: var(--dust-2); }
.week-invite strong { color: var(--chalk); }
.week-invite .button { justify-self: start; }
.onboard { margin: 0 0 26px; }
.plan-week { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--dust-2); }
.plan-week .icon { color: var(--chalk); }
.plans-week-invite { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 6px; }
.week-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.week-row-remove { color: var(--dust-2); font-size: 14px; }
.week-day-chips .chip { min-width: 48px; justify-content: center; padding: 0 10px; }
.week-plans { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--steel-2); }
.week-plan-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--steel-2); }
.week-plan-name { display: grid; min-width: 0; }
.week-plan-name small { font-size: 13px; }
.week-summary { margin: 12px 0 0; }

/* ---------------------------------------------------------------- trener
   Dymek w rogu na każdym ekranie otwiera okno rozmowy: na telefonie od dołu, na komputerze w prawym dolnym rogu.
   Trener mówi bez dymka (komentarz z kreską po lewej), Twoje wiadomości są w szarych blokach.
   Karta propozycji używa wąskich cyfr jak reszta tablicy; pomarańczowy = nowy ciężar (jak w treningu). */

/* Miejsce na dymek pod ostatnim elementem ekranu. */
.screen { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 96px); }
@media (min-width: 900px) { .screen { padding-bottom: 112px; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.coach-fab {
  position: fixed;
  right: var(--pad);
  bottom: calc(var(--tab-h) + var(--safe-b) + 16px);
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 20px 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--chalk);
  color: #000;
  font-size: 17px;
  font-weight: 800;
  font-stretch: 82%;
  white-space: nowrap;
  box-shadow: 0 0 0 4px var(--black);
  cursor: pointer;
}
.coach-fab .icon { width: 24px; height: 24px; stroke-width: 2.2; }
.coach-fab:active { transform: scale(0.94); }
/* Ekrany bez paska zakładek: podsumowanie ma przyciski u dołu, trening sterowanie u dołu i pasek u góry. */
body[data-screen="podsumowanie"] .coach-fab { bottom: calc(var(--safe-b) + 96px); }
/* W trakcie treningu samo kółko z ikoną (napis zasłaniałby nazwę ćwiczenia). */
body[data-screen="trening"] .coach-fab { top: calc(var(--safe-t) + 100px); bottom: auto; justify-content: center; width: 48px; height: 48px; padding: 0; box-shadow: none; background: rgba(0, 0, 0, 0.82); color: var(--chalk); }
body[data-screen="trening"] .coach-fab span { display: none; }
body[data-screen="trening"] .coach-fab .icon { width: 22px; height: 22px; }
/* Pasek wybranych ćwiczeń (Biblioteka, dodawanie ćwiczeń) stoi nad zakładkami: przycisk trenera nad nim. */
body[data-libbar] .coach-fab, body[data-screen="dodaj-cwiczenia"] .coach-fab { bottom: calc(var(--tab-h) + var(--safe-b) + 90px); }

.coach-invite { display: grid; gap: 12px; margin: 0 0 24px; padding: 16px 18px; border-radius: var(--r-l); background: var(--graphite); }
.coach-invite p { margin: 0; color: var(--dust-2); }
.coach-invite strong { color: var(--chalk); }
.coach-invite .button { justify-self: start; }

body.coach-open { overflow: hidden; }
.coach-layer { position: fixed; inset: 0; z-index: 35; }
.coach-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.62); opacity: 0; transition: opacity 0.2s ease; }
.coach-panel {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  width: min(var(--max), 100vw);
  height: calc(100dvh - var(--safe-t) - 28px);
  margin: 0 auto;
  border: 1px solid var(--steel-2);
  border-bottom: 0;
  border-radius: var(--r-l) var(--r-l) 0 0;
  background: var(--black);
  transform: translateY(100%);
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.coach-layer.shown .coach-backdrop { opacity: 1; }
.coach-layer.shown .coach-panel { transform: none; }
.coach-panel-head { display: flex; align-items: center; gap: 4px; padding: 14px 10px 10px var(--pad); border-bottom: 1px solid var(--steel); }
.coach-panel-title { flex: 1; margin: 0; font-size: 36px; font-stretch: 62%; font-weight: 900; line-height: 0.9; letter-spacing: -0.012em; outline: none; }
.coach-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: 18px; padding: 18px var(--pad) 22px; }
.coach-foot { padding: 10px var(--pad) calc(10px + var(--safe-b)); border-top: 1px solid var(--steel); }
.coach-loading { margin: 0; }
.coach-topic { display: inline-flex; align-items: center; gap: 7px; margin: 0; color: var(--dust-2); font-size: 14px; font-weight: 700; }
.coach-topic .icon { width: 17px; height: 17px; }
.coach-empty { display: grid; gap: 14px; }
.coach-hello { margin: 0; padding-left: 14px; border-left: 2px solid var(--steel-2); color: var(--dust-2); font-size: 17px; line-height: 1.5; }
.coach-starters { display: flex; flex-wrap: wrap; gap: 8px; }

.coach-msg.me { justify-self: end; max-width: 86%; padding: 10px 15px; border-radius: 20px 20px 6px 20px; background: var(--graphite-2); }
.coach-msg.me p { margin: 0; white-space: pre-wrap; }
.coach-msg.coach { display: grid; gap: 12px; min-width: 0; }
.coach-text { padding-left: 14px; border-left: 2px solid var(--steel-2); font-size: 17px; line-height: 1.5; }
.coach-text p { margin: 0 0 10px; }
.coach-text p:last-child, .coach-text ul:last-child { margin-bottom: 0; }
.coach-text ul { margin: 0 0 10px; padding-left: 20px; }
.coach-text li + li { margin-top: 4px; }

.coach-card { display: grid; gap: 12px; padding: 16px 18px 18px; border: 1px solid var(--steel-2); border-radius: var(--r-l); background: var(--graphite); }
.coach-card h3 { margin: 0; color: var(--dust-2); font-size: 15px; font-weight: 700; }
.coach-card dl { display: grid; gap: 10px; margin: 0; }
.coach-card dl div { display: grid; gap: 2px; }
.coach-card dt { color: var(--dust); font-size: 13px; font-weight: 700; }
.coach-card dd { margin: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.coach-card .txt dd { font-size: 18px; font-weight: 700; line-height: 1.25; }
.coach-card .num dd { font-stretch: 62%; font-weight: 900; font-size: 46px; line-height: 0.9; font-variant-numeric: tabular-nums; }
.coach-card .num dd small { font-size: 22px; color: var(--dust); }
.coach-card .num dd .icon { align-self: center; width: 22px; height: 22px; color: var(--dust); }
.coach-card .coach-from { color: var(--dust); }
.coach-card:not(.accepted):not(.rejected) .num:first-child dd b { color: var(--change); }
.coach-card-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.coach-card-state { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--dust-2); font-weight: 700; }
.coach-card-state .icon { width: 18px; height: 18px; }
.coach-card.rejected { opacity: 0.55; }

.coach-typing { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: var(--dust); font-size: 15px; font-weight: 600; }
.coach-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--dust); animation: coach-dot 1.2s infinite ease-in-out; }
.coach-typing span:nth-child(2) { animation-delay: 0.15s; }
.coach-typing span:nth-child(3) { animation-delay: 0.3s; margin-right: 6px; }
@keyframes coach-dot { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.coach-error { display: grid; gap: 10px; justify-items: start; padding: 14px 16px; border: 1px solid rgba(255, 90, 79, 0.45); border-radius: var(--r-m); }
.coach-error p { margin: 0; }

.coach-composer { display: flex; align-items: flex-end; gap: 10px; }
.coach-composer textarea { flex: 1; min-width: 0; min-height: 48px; max-height: 160px; padding: 12px 16px; border: 1px solid var(--steel-2); border-radius: 24px; background: var(--graphite); font-size: 17px; line-height: 1.35; resize: none; }
.coach-composer textarea:focus-visible { outline: 2px solid var(--chalk); outline-offset: 1px; }
.coach-send { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--chalk); color: #000; cursor: pointer; }
.coach-send[disabled], .coach-composer textarea[disabled] { opacity: 0.45; }
.coach-note { margin: 0; color: var(--dust-2); font-weight: 600; }

.coach-notes { display: grid; gap: 0; margin: 14px 0 0; padding: 0; list-style: none; }
.coach-notes li { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--steel-2); }
.coach-notes p { margin: 0; }

/* Jedna ciągła rozmowa: dni i omówienia treningu jako znaczniki, starsze wiadomości na żądanie. */
.coach-more { justify-self: center; color: var(--dust-2); font-size: 14px; }
.coach-day { justify-self: center; margin: 6px 0 -4px; padding: 3px 12px; border-radius: 999px; background: var(--graphite); color: var(--dust-2); font-size: 13px; font-weight: 700; }
.coach-day::first-letter { text-transform: uppercase; }
.coach-divider { display: inline-flex; align-items: center; gap: 7px; margin: 0; color: var(--dust-2); font-size: 14px; font-weight: 700; }
.coach-divider .icon { width: 17px; height: 17px; }

/* Administrator: koszt pod odpowiedzią i pasek salda pod nagłówkiem okna. */
.coach-cost { margin: 0; padding-left: 16px; color: var(--dust); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.coach-admin:empty { display: none; }
.coach-admin-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; width: 100%; padding: 9px var(--pad); border: 0; border-bottom: 1px solid var(--steel); background: var(--graphite); color: var(--dust-2); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.coach-admin-bar b { color: var(--chalk); font-weight: 800; font-variant-numeric: tabular-nums; }
.coach-admin-stats { display: grid; gap: 12px; margin: 0; }
.coach-admin-stats div { display: grid; gap: 2px; }
.coach-admin-stats dt { color: var(--dust); font-size: 13px; font-weight: 700; }
.coach-admin-stats dd { margin: 0; font-size: 17px; font-weight: 700; }
.coach-admin-list { display: grid; margin: 0; padding: 0; list-style: none; }
.coach-admin-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--steel-2); }
.coach-admin-list span { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.coach-admin-list small { color: var(--dust); font-size: 13px; }
.coach-admin-list b { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Komputer: okienko w prawym dolnym rogu, strona za nim lekko przyciemniona. */
@media (min-width: 900px) {
  .coach-fab, body[data-screen="podsumowanie"] .coach-fab, body[data-screen="dodaj-cwiczenia"] .coach-fab { bottom: 28px; right: 28px; }
  body[data-libbar] .coach-fab { bottom: 112px; }
  body.coach-open { overflow: auto; }
  .coach-backdrop { background: rgba(0, 0, 0, 0.3); }
  .coach-panel { inset: auto 28px 28px auto; width: 420px; height: min(720px, calc(100dvh - 120px)); border-bottom: 1px solid var(--steel-2); border-radius: var(--r-l); transform: translateY(24px); opacity: 0; transition: transform 0.2s ease, opacity 0.2s ease; }
  .coach-layer.shown .coach-panel { opacity: 1; }
  .coach-foot { padding-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .coach-panel, .coach-backdrop { transition: none; }
  .coach-typing span { animation: none; opacity: 0.6; }
}

/* ---------------------------------------------------------------- panel administratora */

.admin-entry { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; margin: 0 0 18px; padding: 16px 18px; border-radius: var(--r-l); background: var(--graphite); color: var(--chalk); text-decoration: none; }
.admin-entry span { display: grid; gap: 2px; }
.admin-entry small { color: var(--dust); font-size: 14px; }
.admin-title-small { font-size: clamp(30px, 8vw, 48px); overflow-wrap: anywhere; }
.admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 600px) { .admin-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.admin-users, .admin-list, .admin-sets, .admin-notes { margin: 0; padding: 0; list-style: none; }
.admin-user { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--steel-2); color: inherit; text-decoration: none; }
.admin-user-main { display: grid; gap: 3px; min-width: 0; }
.admin-user-main strong { font-size: 17px; overflow-wrap: anywhere; }
.admin-user-main span { color: var(--dust-2); font-size: 14px; }
.admin-user .icon { color: var(--dust); }
.admin-badge { padding: 1px 7px; border: 1px solid var(--steel-2); border-radius: 999px; color: var(--dust-2); font-size: 12px; font-weight: 700; vertical-align: 2px; }
.admin-list li, .admin-sets li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--steel); font-size: 15px; }
.admin-list li > span:last-child, .admin-sets li > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.admin-fold { border-bottom: 1px solid var(--steel-2); }
.admin-fold summary { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; cursor: pointer; font-weight: 700; list-style: none; }
.admin-fold summary::-webkit-details-marker { display: none; }
.admin-fold summary .muted { font-weight: 500; text-align: right; }
.admin-fold[open] summary { color: var(--chalk); }
.admin-sets { padding-bottom: 10px; }
.admin-notes li { padding: 6px 0 6px 12px; border-left: 2px solid var(--steel-2); margin-bottom: 6px; color: var(--dust-2); font-size: 15px; }
.admin-chat { display: grid; gap: 10px; padding: 4px 0 16px; }
.admin-chat-msg { max-width: 92%; padding-left: 12px; border-left: 2px solid var(--steel-2); font-size: 15px; }
.admin-chat-msg.me { justify-self: end; padding: 8px 12px; border: 0; border-radius: 16px 16px 4px 16px; background: var(--graphite-2); }
.admin-chat-msg p { margin: 0 0 6px; white-space: pre-wrap; }
.admin-chat-msg p:last-child { margin: 0; }

/* Komunikaty nad przyciskiem trenera (na treningu przycisk jest u góry, więc tam bez zmian). */
body:not([data-screen="trening"]):not(.coach-open) .toast { bottom: calc(var(--tab-h) + var(--safe-b) + 84px); }
body[data-screen="podsumowanie"]:not(.coach-open) .toast { bottom: calc(var(--safe-b) + 164px); }
@media (min-width: 900px) { body:not([data-screen="trening"]):not(.coach-open) .toast { bottom: 96px; } }
body[data-libbar]:not([data-screen="trening"]):not(.coach-open) .toast { bottom: calc(var(--tab-h) + var(--safe-b) + 164px); }
@media (min-width: 900px) { body[data-libbar]:not([data-screen="trening"]):not(.coach-open) .toast { bottom: 104px; } }
.admin-range { display: grid; gap: 10px; margin-bottom: 10px; }
.admin-range-custom { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.admin-range-custom label { display: grid; gap: 4px; color: var(--dust); font-size: 13px; font-weight: 700; }
.admin-range-custom input, .admin-limit input { min-height: 44px; padding: 0 12px; border: 1px solid var(--steel-2); border-radius: var(--r-s); background: var(--graphite); color: var(--chalk); font-size: 16px; }
.admin-range-sum { margin: 4px 0 6px; color: var(--dust-2); }
.admin-range-sum b { color: var(--chalk); font-size: 20px; }
.admin-coach p { margin: 0; }
.admin-limit { display: grid; gap: 4px; max-width: 220px; color: var(--dust); font-size: 13px; font-weight: 700; }
.admin-coach-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---------------------------------------------------------------- moje ciężary (Konto → Mój sprzęt)
   Pod zaznaczonymi hantlami albo kettlebellem: regulowane (od, do, co ile) albo stała masa (zaznaczane masy). */
.gear-weights { display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--steel); }
.gear-title { margin: 0; font-size: 15px; font-weight: 800; }
.gear-sizes .chip { min-width: 52px; justify-content: center; font-variant-numeric: tabular-nums; }
.gear-range { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.gear-range label { display: inline-flex; gap: 8px; align-items: center; color: var(--dust); font-size: 14px; }
.gear-select { min-width: 84px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- plany według sprzętu (ekran Plany) */
.plans-gear-hint { margin: 18px 0 0; }
.plans-gear-hint a { color: var(--chalk); }
.plans-other { margin-top: 34px; border-top: 1px solid var(--steel); }
.plans-other > summary { display: flex; gap: 6px; align-items: baseline; min-height: 52px; padding: 16px 0 6px; font-weight: 800; cursor: pointer; list-style: none; }
.plans-other > summary::-webkit-details-marker { display: none; }
.plans-other > summary::before { content: '+'; width: 1ch; color: var(--dust); }
.plans-other[open] > summary::before { content: '–'; }
.plans-other .plan-group:first-of-type .group-title { margin-top: 10px; }
/* Długi kod planu jednym słowem (np. „Kettlebell A”) nie łamie się w środku słowa. */
.plan-hero-long { font-size: clamp(64px, 18.5vw, 150px); }

/* Trener: karta „Nowy plan” — plany z listą ćwiczeń */
.coach-card-plan { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--steel-2); }
.coach-card-plan:first-of-type { padding-top: 0; border-top: 0; }
.coach-card-plan h4 { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 18px; line-height: 1.2; }
.coach-card-plan h4 span { color: var(--dust); font-size: 13px; font-weight: 600; }
.coach-card-plan ol { margin: 0; padding: 0; list-style: none; counter-reset: cp; display: grid; gap: 6px; }
.coach-card-plan li { counter-increment: cp; display: grid; grid-template-columns: 22px 1fr; column-gap: 6px; line-height: 1.3; }
.coach-card-plan li::before { content: counter(cp); grid-row: span 2; color: var(--dust); font-variant-numeric: tabular-nums; font-size: 13px; padding-top: 2px; }
.coach-card-plan li span { font-weight: 600; }
.coach-card-plan li small { color: var(--dust); font-size: 13px; }
.coach-card-state .link-button { margin-left: 6px; }
