/* Design system: logo w kolorze marki „pomarańcz” #fb902a (public/logo-light.png, logo-dark.png), krój Montserrat,
   cyfry i nagłówki Space Grotesk (--font-display). Akcent interfejsu domyślnie pomarańcz z logo, do wyboru
   w Ustawieniach: pomarańcz, malina, lawenda, morski (atrybut data-accent na <html>; domyślny – bez atrybutu).
   Styl: siatka kropek i poświata akcentu w tle, cienkie ramki, poświata przy aktywnych elementach.
   --accent    – wypełnienia (przyciski, wyróżnienia); tekst na nim: --on-accent (kontrast ≥ 4,5:1)
   --accent-ink – akcent jako tekst/linie na tle strony (kontrast ≥ 4,5:1) */
@font-face {
  font-family: 'Space Grotesk'; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(/fonts/spacegrotesk-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk'; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(/fonts/spacegrotesk-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Montserrat'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/montserrat-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Montserrat'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/montserrat-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f6f3f0; --surface: #ffffff; --surface-2: #faf8f6; --text: #1f1c1a; --muted: #6b625b; --line: #ebe4dd;
  --accent: #fb902a; --accent-ink: #a85400; --accent-soft: #fff1e3; --on-accent: #1f1c1a; --accent-hero: #fb902a;
  --hero-bg: #ffffff; --hero-text: #1f1c1a; --hero-muted: #6b625b;
  --dots: rgb(31 28 26 / .075);
  --warn: #a15c07; --warn-line: #f59e0b;
  --logo-bg: #ffffff; --good: #15803d; --good-soft: #e7f6ec; --bad: #b91c1c; --bad-soft: #fdeceb;
  --shadow-sm: 0 1px 2px rgb(31 27 24 / .06);
  --shadow: 0 1px 2px rgb(31 27 24 / .05), 0 6px 20px -8px rgb(31 27 24 / .14);
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Montserrat', system-ui, sans-serif;
  --radius: 16px; --radius-sm: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0a0e; --surface: #17141a; --surface-2: #1f1b22; --text: #f3eee9; --muted: #a89f97; --line: #2e2830;
    --accent: #fb902a; --accent-ink: #ffad5c; --accent-soft: #3a2612; --on-accent: #1a1410; --accent-hero: #fb902a;
    --hero-bg: #17141a; --hero-text: #f3eee9; --hero-muted: #a89f97;
    --dots: rgb(255 255 255 / .06);
    --warn: #fbbf24; --warn-line: #f59e0b;
    --good: #4ade80; --good-soft: #163322; --bad: #f87171; --bad-soft: #3b1a1a;
    --shadow-sm: none; --shadow: 0 8px 24px -12px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0a0e; --surface: #17141a; --surface-2: #1f1b22; --text: #f3eee9; --muted: #a89f97; --line: #2e2830;
  --accent: #fb902a; --accent-ink: #ffad5c; --accent-soft: #3a2612; --on-accent: #1a1410; --accent-hero: #fb902a;
  --hero-bg: #17141a; --hero-text: #f3eee9; --hero-muted: #a89f97;
  --dots: rgb(255 255 255 / .06);
  --warn: #fbbf24; --warn-line: #f59e0b;
  --good: #4ade80; --good-soft: #163322; --bad: #f87171; --bad-soft: #3b1a1a;
  --shadow-sm: none; --shadow: 0 8px 24px -12px rgb(0 0 0 / .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; text-wrap: balance; }
h1 { font-size: 1.75rem; letter-spacing: -.02em; } h2 { font-size: 1.15rem; letter-spacing: -.01em; } h3 { font-size: 1rem; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.grow { flex: 1; min-width: 0; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Nagłówek */
.logo { display: block; background: var(--logo-bg); border-radius: 10px; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; padding-top: max(10px, env(safe-area-inset-top)); z-index: 10; }
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.topbar .brand .logo { width: 38px; height: 38px; padding: 2px; box-shadow: var(--shadow-sm); }
.topbar .spacer { flex: 1; }
.mainnav { display: flex; gap: 2px; margin-left: 16px; }
.mainnav a { display: flex; align-items: center; gap: 7px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; padding: 8px 12px; border-radius: 99px; transition: background .15s, color .15s; }
.mainnav a:hover { color: var(--text); background: var(--surface-2); }
.mainnav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); }
.mainnav a[aria-current="page"] .icon { color: var(--accent-ink); }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; margin-right: 4px; }
.user-name { display: grid; line-height: 1.2; min-width: 0; }
.user-name strong { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-name span { font-size: .72rem; color: var(--muted); }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: .85rem; letter-spacing: .02em; }
.icon-btn { flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
main { max-width: 1080px; margin: 0 auto; padding: 28px 20px 56px; }

/* Bloki */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.back { margin: 0 0 12px; font-size: .9rem; font-weight: 600; }
.back a { text-decoration: none; }
.page-person { display: flex; align-items: center; gap: 14px; }
.page-person .avatar { width: 52px; height: 52px; font-size: 1.05rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 9px 16px; border-radius: 99px; cursor: pointer; font-weight: 600; font-size: .88rem; transition: border-color .15s, background .15s, filter .15s; text-decoration: none; color: var(--text); }
.btn .icon { width: 18px; height: 18px; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 4px 14px -6px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.link { border: 0; background: none; padding: 4px 6px; color: var(--accent-ink); border-radius: 6px; box-shadow: none; }
.btn.link:hover { text-decoration: underline; }
.btn.danger { color: var(--bad); }
.btn-group { display: flex; gap: 4px; }

/* Zakładki – kontrolka segmentowa */
.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; box-shadow: var(--shadow-sm); }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: flex; align-items: center; gap: 7px; border: 0; background: none; padding: 9px 16px; cursor: pointer; color: var(--muted); border-radius: 99px; white-space: nowrap; font-weight: 600; font-size: .9rem; transition: background .15s, color .15s; }
.tab .icon { width: 18px; height: 18px; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--on-accent); background: var(--accent); }

label.field { display: flex; flex-direction: column; gap: 5px; font-size: .8rem; font-weight: 600; color: var(--muted); }
input, select, textarea { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; width: 100%; font-weight: 400; transition: border-color .15s, background .15s; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
input:focus, select:focus, textarea:focus { background: var(--surface); }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .tab:focus-visible, .icon-btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.error { color: var(--bad); min-height: 1.2em; }

/* Logowanie */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 80px); color: var(--hero-text); background:
  radial-gradient(circle at 110% -10%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 45%),
  radial-gradient(circle at -20% 120%, color-mix(in srgb, var(--accent) 25%, transparent), transparent 45%), var(--hero-bg); }
.login-hero .logo { width: 72px; height: 72px; padding: 4px; margin-bottom: 28px; }
.login-hero h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 10px; }
.login-lead { font-size: 1.1rem; color: var(--hero-muted); margin: 0 0 28px; max-width: 30ch; }
.login-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.login-points li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.login-points .icon { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-hero); }
.login { align-self: center; justify-self: center; width: min(400px, calc(100% - 32px)); margin: 32px 16px; padding: 32px; }
.login h2 { font-size: 1.5rem; margin-bottom: 4px; }
.login form { display: grid; gap: 14px; margin-top: 20px; }
.login .btn.primary { padding: 12px; font-size: 1rem; }
@media (max-width: 820px) {
  .login-wrap { grid-template-columns: 1fr; min-height: 0; }
  .login-hero { padding: 36px 20px 64px; }
  .login-hero .logo { width: 56px; height: 56px; margin-bottom: 18px; }
  .login-points { display: none; }
  .login-lead { margin: 0; }
  .login { margin: -40px auto 32px; position: relative; z-index: 1; }
}

/* Panel powitalny zawodnika */
.hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; padding: 26px 28px; margin-bottom: 20px; border-radius: 20px; color: var(--hero-text); background:
  radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--accent) 50%, transparent), transparent 50%), var(--hero-bg); box-shadow: var(--shadow); }
.hero h1 { margin: 0 0 16px; font-size: clamp(1.6rem, 4vw, 2.1rem); }
.hero-label { display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-hero); }
.hero-label .icon { width: 16px; height: 16px; }
.hero-when { font-size: 1.35rem; font-weight: 700; margin: 2px 0; }
.hero-sub { color: var(--hero-muted); font-size: .88rem; margin: 0; }
.hero-pass { display: flex; align-items: center; gap: 14px; padding: 12px 18px 12px 12px; border-radius: 16px; background: rgb(255 255 255 / .07); border: 1px solid rgb(255 255 255 / .1); }
.hero-pass strong { display: block; }
.ring { width: 84px; height: 84px; flex: none; }
.ring circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.ring-track { stroke: rgb(255 255 255 / .14); }
.ring-booked { stroke: color-mix(in srgb, var(--accent) 40%, transparent); }
.ring-done { stroke: var(--accent); }
.ring-num { fill: var(--hero-text); font: 700 17px var(--font); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .7rem; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; vertical-align: middle; }
.badge.gray { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 700; font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; background: var(--surface-2); }
th:first-child { border-radius: 8px 0 0 8px; } th:last-child { border-radius: 0 8px 8px 0; }
thead th { border-bottom: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

details.plan { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 12px; background: var(--surface); box-shadow: var(--shadow); }
details.plan[open] { box-shadow: inset 0 3px 0 var(--accent), var(--shadow); }
details.plan summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
details.plan summary::-webkit-details-marker { display: none; }
details.plan summary::after { content: ''; margin-left: auto; width: 9px; height: 9px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; flex: none; }
details.plan[open] summary::after { transform: rotate(-135deg); }
.day-title { display: inline-block; margin: 18px 0 8px; padding: 4px 12px; border-radius: 99px; font-size: .72rem; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); text-transform: uppercase; letter-spacing: .06em; }

/* Kafelki pomiarów */
.kpi-grid { margin-bottom: 16px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: grid; gap: 4px; min-width: 0; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi .label { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.kpi .value { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.15; }
.kpi .value small { font-size: .9rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; font-size: .75rem; color: var(--muted); }
.spark { width: 100%; height: 32px; display: block; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.delta { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .74rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.good { color: var(--good); background: var(--good-soft); } .delta.bad { color: var(--bad); background: var(--bad-soft); } .delta.neutral { color: var(--muted); background: var(--surface-2); }

.chart svg { width: 100%; height: auto; display: block; }
.chart .gridline { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--accent); opacity: .12; }
.chart .dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.chart .dot:last-of-type { fill: var(--accent); }

.client-list { list-style: none; margin: 0; padding: 0; }
.client-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.client-list li:last-child { border-bottom: 0; }
.client-list li a { text-decoration: none; color: var(--text); }
.client-list li a.btn { color: var(--text); }
.ex-row { display: grid; grid-template-columns: 1fr 4.5em 2fr .6fr .7fr .9fr 5.5em .7fr 4.5em auto; gap: 6px; margin-bottom: 6px; }
.ex-row-actions { display: flex; align-items: center; gap: 2px; }
@media (max-width: 720px) { .ex-row { grid-template-columns: 1fr 1fr; } .ex-row .ex-name { grid-column: span 2; } }
.empty { padding: 28px; text-align: center; color: var(--muted); }

select.auto-width { width: auto; border-radius: 99px; padding-right: 32px; background-color: var(--surface); }
.badge.warn { background: var(--bad-soft); color: var(--bad); }

/* Karnety */
.pass-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-bottom: 16px; }
.pass-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 10px; min-width: 0; box-shadow: var(--shadow); }
.pass-card.state-active, .pass-card.state-fully_booked { box-shadow: inset 0 3px 0 var(--accent), var(--shadow); }
.pass-bar { position: relative; height: 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.pass-bar span { position: absolute; inset: 0 auto 0 0; border-radius: 99px; }
.pass-bar .booked { background: var(--accent); opacity: .3; }
.pass-bar .done { background: linear-gradient(90deg, #ffb066, var(--accent)); }
.pass-stats { font-size: .85rem; font-variant-numeric: tabular-nums; }

/* Kalendarz */
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.cal-toolbar h2 { margin: 0; font-size: 1.3rem; }
.cal-toolbar h2 .muted { font-weight: 500; }
.cal-toolbar .spacer { flex: 1; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { padding: 4px 6px 6px; font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; text-align: center; }
.cal-cell { min-height: 96px; padding: 5px; border-radius: 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 3px; min-width: 0; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.cal-cell.other { background: transparent; border-color: var(--line); border-style: dashed; }
.cal-cell.other .cal-day { color: var(--muted); opacity: .55; }
.cal-cell.editable { cursor: pointer; }
.cal-cell.editable:hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.cal-cell.today { border-color: var(--accent); background: var(--surface); }
.cal-day { font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; align-self: flex-end; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 99px; }
.cal-cell.today .cal-day { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.chip { display: flex; align-items: baseline; gap: 4px; width: 100%; min-width: 0; padding: 3px 7px; border-radius: 7px; font: 600 .72rem/1.3 var(--font); text-align: left; border: 1px solid transparent; overflow: hidden; white-space: nowrap; }
button.chip { cursor: pointer; }
button.chip:hover { filter: brightness(.97); }
.chip .chip-name { overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.chip .chip-seq { margin-left: auto; font-variant-numeric: tabular-nums; }
.chip.status-planned { background: var(--surface); color: var(--text); border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.chip.status-done { background: var(--accent); color: var(--on-accent); }
.chip.status-cancelled { background: transparent; color: var(--muted); border-color: var(--line); text-decoration: line-through; }
.chip.no-pass { border-style: dashed; border-color: var(--bad); box-shadow: inset 3px 0 0 var(--bad); }
.cal-legend { display: grid; gap: 10px; margin-top: 14px; }
.cal-legend-row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.cal-legend-title { min-width: 4.8em; font-weight: 700; color: var(--text); }
.legend-log { display: inline-flex; align-items: flex-start; }
.legend-log .log-mark { margin-top: .2em; vertical-align: 0; }
.cal-legend .chip { width: auto; }
.card.inset { background: var(--surface-2); margin: 0 0 14px; box-shadow: none; }
.agenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.agenda li { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.agenda li.is-today { border-color: var(--accent); background: var(--accent-soft); }
.date-tile { flex: none; width: 54px; display: grid; justify-items: center; padding: 6px 0; border-radius: 12px; background: var(--surface-2); line-height: 1.1; }
.agenda li.is-today .date-tile { background: var(--accent); color: var(--on-accent); }
.date-tile span { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: inherit; opacity: .75; }
.date-tile strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.agenda-main { flex: 1; min-width: 0; }
.agenda-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.agenda-time { font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.seq-pill { flex: none; padding: 4px 10px; border-radius: 99px; font-weight: 700; font-size: .8rem; font-variant-numeric: tabular-nums; background: var(--accent-soft); color: var(--accent-ink); }
.agenda li.is-today .seq-pill { background: var(--surface); }

/* Role */
.role-badge { margin-left: 6px; vertical-align: middle; }
select.compact { padding: 2px 6px; font-size: .85rem; width: auto; }

/* Telefon: dolne menu */
@media (max-width: 720px) {
  h1 { font-size: 1.45rem; }
  main { padding: 18px 14px calc(92px + env(safe-area-inset-bottom)); }
  /* Phone: no backdrop-filter on the header – it would trap the fixed bottom menu inside the header. */
  .topbar { padding-left: 14px; padding-right: 14px; backdrop-filter: none; background: var(--surface); }
  .topbar .brand-name, .user-name { display: none; }
  .user-chip { margin-right: 0; }
  .user-chip .avatar { width: 34px; height: 34px; font-size: .78rem; }
  .icon-btn { width: 36px; height: 36px; }
  .mainnav, .tabs.primary-tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; margin: 0; width: auto; max-width: none;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; padding: 6px 6px max(6px, env(safe-area-inset-bottom));
    border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: 0 -6px 20px -12px rgb(0 0 0 / .25);
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  }
  .mainnav a, .tabs.primary-tabs .tab { flex-direction: column; gap: 3px; padding: 6px 2px; font-size: .68rem; border-radius: 12px; background: none; color: var(--muted); justify-content: center; }
  .mainnav a .icon, .tabs.primary-tabs .tab .icon { width: 22px; height: 22px; }
  .mainnav a[aria-current="page"], .tabs.primary-tabs .tab[aria-selected="true"] { background: none; color: var(--accent-ink); }
  .mainnav a[aria-current="page"] .icon, .tabs.primary-tabs .tab[aria-selected="true"] .icon { background: var(--accent-soft); border-radius: 99px; width: 48px; padding: 0 13px; }
  .tab { padding: 8px 12px; font-size: .85rem; }
  .card { padding: 16px; }
  .hero { padding: 22px 20px; border-radius: 18px; }
  .hero-pass { width: 100%; }
  .cal-grid { gap: 2px; }
  .cal-cell { min-height: 58px; padding: 2px; border-radius: 7px; }
  .cal-day { width: 22px; height: 22px; font-size: .74rem; align-self: center; }
  .chip { padding: 1px 3px; font-size: .62rem; justify-content: center; box-shadow: none; }
  .chip .chip-name, .chip .chip-seq { display: none; }
  .cal-toolbar h2 { font-size: 1.1rem; width: 100%; order: -1; }
  .cal-toolbar .spacer { display: none; }
  .agenda li { flex-wrap: wrap; gap: 6px 12px; }
  .agenda-main { flex: 1 1 calc(100% - 80px); }
  .agenda .seq-pill { margin-left: 66px; }
  .agenda li > .btn.link { margin-left: auto; }
  .chart .axis { font-size: 19px; }
}

/* Biblioteka ćwiczeń */
/* Exercise figures: outlined mannequin, shirt/shorts, muscles in the accent colour. */
:root { --fig-out: #2b2622; --fig-skin: #efe4da; --fig-skin2: #d6c6b8; --fig-shirt: #2f7a7c; --fig-shirt2: #256163; --fig-lips: #c0606a; --fig-shorts: #2f2a27;
  --fig-shoe: #4a4440; --fig-shoe2: #3a3532; --fig-sole: #f7f3ef; --fig-hair: #2b2622; --fig-steel: #9aa1a8; --fig-plate: #3a3633; --fig-plate2: #6b645e;
  --fig-pad: #4a3f39; --fig-wood: #d9a46a; --fig-wood2: #b07d45; --fig-wall: #e3dbd3; --fig-ball: #b5543a; --fig-floor: #d9d2cb; --fig-shadow: rgba(0,0,0,.08); --fig-bg: var(--accent-soft); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --fig-out: #15110f; --fig-skin: #e2d5ca; --fig-skin2: #a99a8e; --fig-shirt: #4fa3a5; --fig-shirt2: #3b8284; --fig-shorts: #3d3734;
  --fig-shoe: #2a2523; --fig-shoe2: #221e1c; --fig-steel: #b3b9bf; --fig-plate: #5e5752; --fig-plate2: #8a827b; --fig-pad: #6a5a50; --fig-wood: #b9844c; --fig-wood2: #8a5f30; --fig-wall: #5a514a; --fig-floor: #4a433d; --fig-shadow: rgba(0,0,0,.3); } }
:root[data-theme="dark"] { --fig-out: #15110f; --fig-skin: #e2d5ca; --fig-skin2: #a99a8e; --fig-shirt: #4fa3a5; --fig-shirt2: #3b8284; --fig-shorts: #3d3734;
  --fig-shoe: #2a2523; --fig-shoe2: #221e1c; --fig-steel: #b3b9bf; --fig-plate: #5e5752; --fig-plate2: #8a827b; --fig-pad: #6a5a50; --fig-wood: #b9844c; --fig-wood2: #8a5f30; --fig-wall: #5a514a; --fig-floor: #4a433d; --fig-shadow: rgba(0,0,0,.3); }
.fig { width: 100%; height: auto; display: block; background: var(--fig-bg); border-radius: 10px; }
.fig .fig-f-skin { fill: var(--fig-skin); } .fig .fig-s-skin { stroke: var(--fig-skin); }
.fig .fig-f-skin2 { fill: var(--fig-skin2); } .fig .fig-s-skin2 { stroke: var(--fig-skin2); }
.fig .fig-f-shirt { fill: var(--fig-shirt); } .fig .fig-s-shirt { stroke: var(--fig-shirt); }
.fig .fig-f-shirt2 { fill: var(--fig-shirt2); } .fig .fig-s-shirt2 { stroke: var(--fig-shirt2); }
.fig .fig-f-shorts { fill: var(--fig-shorts); } .fig .fig-s-shorts { stroke: var(--fig-shorts); }
.fig .fig-f-shoe { fill: var(--fig-shoe); } .fig .fig-s-shoe { stroke: var(--fig-shoe); }
.fig .fig-f-shoe2 { fill: var(--fig-shoe2); } .fig .fig-s-shoe2 { stroke: var(--fig-shoe2); }
.fig .fig-f-sole { fill: var(--fig-sole); } .fig .fig-s-sole { stroke: var(--fig-sole); }
.fig .fig-f-hair { fill: var(--fig-hair); } .fig .fig-s-hair { stroke: var(--fig-hair); }
.fig .fig-f-steel { fill: var(--fig-steel); } .fig .fig-s-steel { stroke: var(--fig-steel); }
.fig .fig-f-plate { fill: var(--fig-plate); } .fig .fig-s-plate { stroke: var(--fig-plate); }
.fig .fig-f-plate2 { fill: var(--fig-plate2); } .fig .fig-s-plate2 { stroke: var(--fig-plate2); }
.fig .fig-f-pad { fill: var(--fig-pad); } .fig .fig-s-pad { stroke: var(--fig-pad); }
.fig .fig-f-wood { fill: var(--fig-wood); } .fig .fig-s-wood { stroke: var(--fig-wood); }
.fig .fig-f-wood2 { fill: var(--fig-wood2); } .fig .fig-s-wood2 { stroke: var(--fig-wood2); }
.fig .fig-f-wall { fill: var(--fig-wall); } .fig .fig-s-wall { stroke: var(--fig-wall); }
.fig .fig-f-ball { fill: var(--fig-ball); } .fig .fig-s-ball { stroke: var(--fig-ball); }
.fig .fig-f-floor { fill: var(--fig-floor); } .fig .fig-s-floor { stroke: var(--fig-floor); }
.fig .fig-f-shadow { fill: var(--fig-shadow); } .fig .fig-s-shadow { stroke: var(--fig-shadow); }
.fig .fig-s-out { stroke: var(--fig-out); } .fig .fig-f-out { fill: var(--fig-out); } .fig .fig-f-eye { fill: var(--fig-out); } .fig .fig-s-lips { stroke: var(--fig-lips); } .fig .fig-s-padline { stroke: var(--fig-pad); }
.fig .fig-f-hi { fill: var(--accent); } .fig .fig-s-hi { stroke: var(--accent); } .fig .fig-hi { opacity: .92; } .fig .fig-f-shine { fill: #fff; opacity: .35; }
.fig-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fig-pair.single { grid-template-columns: minmax(0, 1fr); max-width: 50%; }
.fig-pair figure { margin: 0; text-align: center; min-width: 0; }
.fig-pair figcaption { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
.fig-pair.small { gap: 4px; }
.fig-pair.small.single { max-width: none; grid-template-columns: 1fr 1fr; }
.fig-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); font-size: .8rem; line-height: 1.4; }
.fig-note svg { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--accent-ink); }
.fig-none { display: grid; place-items: center; aspect-ratio: 12 / 5; background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: .8rem; }
.lib-tools { display: grid; gap: 10px; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 5px 12px; font-size: .82rem; font-weight: 600; cursor: pointer; color: var(--muted); }
.chip-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ex-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ex-card { display: grid; gap: 6px; align-content: start; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; cursor: pointer; min-width: 0; }
.ex-card:hover { border-color: var(--accent); }
.ex-card:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.ex-card .badge { justify-self: start; }
.btn.link.ex-link { padding: 0; text-align: left; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; font-weight: 500; color: var(--text); }
.ex-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--surface); color: var(--text); }
.ex-dialog::backdrop { background: rgb(0 0 0 / .45); }
.ex-dialog .fig-pair { margin: 14px 0; }
.ex-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 6px; font-size: .9rem; }
.ex-meta dt { color: var(--muted); font-weight: 600; }
.ex-meta dd { margin: 0; }
.ex-dialog ol, .ex-dialog ul { padding-left: 20px; margin: 4px 0 12px; }
.ex-dialog li { margin-bottom: 4px; }
.ex-edit { display: grid; gap: 10px; margin-top: 14px; }
.ex-card { box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.ex-card:hover { transform: translateY(-2px); }
.ex-dialog { border-radius: 20px; box-shadow: 0 24px 60px -20px rgb(0 0 0 / .5); }
.lib-tools input[type=search] { border-radius: 99px; padding-left: 16px; }
td:first-child { white-space: nowrap; }

/* Cele */
.goals { margin-bottom: 24px; }
.goal-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-bottom: 12px; }
.goal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 10px; box-shadow: var(--shadow); min-width: 0; }
.goal-card.reached { border-color: var(--accent); background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%); }
.goal-card.archived { opacity: .75; box-shadow: none; }
.goal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.goal-pct { font-weight: 700; font-size: 1.25rem; color: var(--accent-ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.goal-bar { display: block; position: relative; height: 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.goal-bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(90deg, #ffb066, var(--accent)); }
.goal-vals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.goal-vals span { display: grid; gap: 1px; }
.goal-vals span:nth-child(2) { text-align: center; } .goal-vals span:last-child { text-align: right; }
.goal-vals b { font-size: .95rem; color: var(--text); text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.hero-side { display: grid; gap: 10px; }
.hero-goal { display: grid; gap: 6px; text-align: left; padding: 12px 16px; border-radius: 16px; background: rgb(255 255 255 / .07); border: 1px solid rgb(255 255 255 / .1); color: var(--hero-text); cursor: pointer; }
.hero-goal:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.hero-goal-title { font-weight: 700; }
.hero-goal .goal-bar { height: 8px; background: rgb(255 255 255 / .14); border: 0; }
@media (max-width: 720px) { .hero-side { width: 100%; } }

/* Numeracja ćwiczeń i obwody */
.plan-table td.ex-code { width: 3.2em; }
.code-pill { display: inline-block; min-width: 2.2em; padding: 2px 8px; border-radius: 8px; text-align: center; font-weight: 700; font-size: .82rem; font-variant-numeric: tabular-nums; background: var(--surface-2); border: 1px solid var(--line); }
.plan-table tr.in-circuit td { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.plan-table tr.in-circuit td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.plan-table tr.in-circuit .code-pill { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.plan-table tr.circuit-head td { padding: 12px 8px 6px; font-size: .8rem; color: var(--muted); border-bottom: 0; background: none; }
.plan-table tr.circuit-head:hover td { background: none; }
.ex-code-input { text-align: center; }
.tempo { font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: .12em; cursor: help; }
.ex-tempo-input { text-align: center; letter-spacing: .1em; text-transform: uppercase; }
.tempo-legend { margin-top: 12px; }

/* Dziennik treningu */
.ex-dialog.wide { width: min(760px, calc(100vw - 24px)); }
/* Who filled the training log in (calendar): round badges of one size – check = trainer / owner, pencil = client.
   On a filled (done) event: white badge, accent icon; on an outlined event and in the legend: accent badge, white icon. */
.log-mark { display: inline-flex; align-items: center; gap: 2px; margin-right: 4px; flex: none; vertical-align: -2px; }
.log-mark .lm { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.log-mark .lm .icon { width: 10px; height: 10px; stroke-width: 3; }
.status-done:not(.solo) .log-mark .lm { background: var(--surface); color: var(--accent-ink); }
.chip:has(.log-mark) { align-items: center; }
.has-log.log-draft .log-mark, .legend-log.log-draft .log-mark { opacity: .5; }
@media (max-width: 720px) {
  /* Narrow month cells: the badges stay visible at the start, the time is cut at the end. */
  .chip:has(.log-mark) { justify-content: flex-start; }
  .chip .log-mark { gap: 0; margin-right: 2px; }
  .chip .log-mark .lm { width: 11px; height: 11px; }
  .chip .log-mark .lm + .lm { margin-left: -3px; box-shadow: 0 0 0 1px var(--accent); } /* two badges overlap */
  .chip .log-mark .lm .icon { width: 8px; height: 8px; }
  .cal-legend-title { flex-basis: 100%; }
}
.log-items { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 10px; }
.ex-dialog .log-items > li { margin: 0; }
.log-item, .log-edit-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface); display: grid; gap: 8px; }
.log-item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.log-edit-item .log-item-head .ex-code-input { width: 4.2em; flex: none; }
.log-edit-item .log-item-head input[name=name] { flex: 1; min-width: 160px; }
.log-sets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: set; }
.ex-dialog .log-sets li { counter-increment: set; margin: 0; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.log-sets li::before { content: counter(set) ". "; color: var(--muted); font-weight: 500; }
.log-sets-edit { display: grid; gap: 6px; }
.set-row { display: grid; grid-template-columns: 2em 1fr 1.4fr auto; gap: 6px; align-items: center; }
.set-no { color: var(--muted); font-weight: 700; font-size: .85rem; text-align: right; }
.log-edit-items { display: grid; gap: 10px; margin-bottom: 10px; }
.log-note { border-radius: 12px; padding: 10px 12px; font-size: .9rem; display: grid; gap: 2px; margin: 8px 0; }
.log-note strong { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.log-note.trainer { background: var(--surface-2); border-left: 3px solid var(--muted); }
.log-note.client { background: var(--accent-soft); border-left: 3px solid var(--accent); }
.log-note.client strong { color: var(--accent-ink); }
.log-client { display: grid; gap: 10px; margin-top: 8px; }
.log-list .btn { flex: none; }
.log-list li > .btn { margin-left: auto; }
.ex-dialog .log-items, .ex-dialog .log-sets { padding: 0; margin-left: 0; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dlg-head > div { min-width: 0; }

/* Obciążenia */
td.num-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-item-foot { display: grid; grid-template-columns: 6.5em 1fr; gap: 8px; align-items: end; }
.pct-field input { text-align: center; }
.rpe-field { max-width: 420px; }
.unit-summary { margin: 12px 0; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.unit-summary dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px 14px; margin: 6px 0 0; }
.unit-summary dt { font-size: .7rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.unit-summary dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.stats-head .hero-label { color: var(--accent-ink); }
.stat-tiles .kpi .value { font-size: 1.45rem; }
.kpi-grid.stat-tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.meso-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); margin-bottom: 16px; }
.meso-card { margin: 0; display: grid; gap: 10px; }
.meso-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.meso-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.meso-stats div { display: grid; }
.meso-stats b { font-variant-numeric: tabular-nums; }
.meso-stats span { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.week-bars { width: 100%; height: auto; display: block; }
.week-bars .baseline { stroke: var(--line); }
.week-bars .bar { fill: var(--accent); }
.week-bars .hit { fill: transparent; }
.week-bars g:hover .bar { fill: var(--accent-ink); }
.week-bars text { font-family: var(--font); fill: var(--muted); }
.week-bars .bar-val { font-size: 12px; font-weight: 700; fill: var(--text); }
.week-bars .bar-lab { font-size: 11px; font-weight: 700; }
.week-bars .bar-sub { font-size: 10px; }
tr.total-row td { border-top: 2px solid var(--line); font-weight: 700; }
.stats-notes p { margin: 4px 0; }
td.nowrap, .meso-stats b { white-space: nowrap; }

/* Rozpis tygodni */
.week-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 6px; }
.week-info { margin-bottom: 4px; }
/* Written-out weeks (own values) – green tick; the others repeat the previous week. */
.chip-btn.week-written:not([aria-pressed="true"]) { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.week-check { font-weight: 800; margin-right: 4px; }
.week-legend { margin: -2px 0 6px; }
/* Plan row whose week values come from an approved training log */
.done-tag { display: flex; align-items: center; gap: 3px; width: fit-content; max-width: 100%; margin-top: 4px; padding: 1px 7px; border-radius: 99px; background: var(--good-soft); color: var(--good); font-size: .7rem; font-weight: 700; line-height: 1.4; }
.done-tag .icon { width: 12px; height: 12px; stroke-width: 3; }
.week-legend .week-check { color: var(--good); margin-right: 0; }
.week-count { display: inline-grid; place-items: center; min-width: 2.2em; font-weight: 700; }
.week-editor input { padding: 7px 8px; min-width: 7em; }
.week-editor input.we-s { min-width: 4.2em; width: 4.8em; }
.week-editor td { vertical-align: middle; padding: 6px 4px; }
.week-editor .we-name { min-width: 150px; }
.week-schedule tr.meso-row td { background: var(--surface-2); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); }
.week-schedule tr.is-now td { background: var(--accent-soft); }
.week-schedule tr.is-now td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.week-schedule .nowrap { white-space: nowrap; }
.ex-dialog.xwide { width: min(1180px, calc(100vw - 24px)); }
.rpe-select { width: auto; min-width: 4.5em; max-width: 6.5em; padding: 5px 6px; font-size: .85rem; font-weight: 700; }
.rpe-select.saved { border-color: var(--good); box-shadow: 0 0 0 2px var(--good-soft); }
.rpe-select { max-width: 5em; }

/* Animacje przejść */
@media (prefers-reduced-motion: no-preference) {
  .page-enter { animation: page-in .32s cubic-bezier(.2, .7, .2, 1) backwards; }
  .page-enter > * { animation: page-in .38s cubic-bezier(.2, .7, .2, 1) backwards; }
  .page-enter > *:nth-child(2) { animation-delay: .04s; }
  .page-enter > *:nth-child(3) { animation-delay: .08s; }
  .page-enter > *:nth-child(n+4) { animation-delay: .12s; }
  @keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  dialog[open] { animation: dialog-in .24s cubic-bezier(.2, .7, .2, 1); }
  dialog[open]::backdrop { animation: fade-in .24s ease-out; }
  @keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
  .tab, .chip-btn, .card, .kpi, .goal-card, .ex-card { transition: background .2s, color .2s, border-color .2s, box-shadow .2s, transform .2s; }
  .goal-bar > span, .pass-bar span { transition: width .6s cubic-bezier(.2, .7, .2, 1); }
}

/* Grupy zawodników */
.client-group { padding-top: 16px; }
.group-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 4px; }
.group-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.group-count { display: inline-grid; place-items: center; min-width: 1.9em; height: 1.9em; padding: 0 6px; border-radius: 99px; font-size: .8rem; background: var(--surface-2); border: 1px solid var(--line); }
.group-ending { box-shadow: inset 4px 0 0 var(--bad), var(--shadow); }
.group-ending .group-count { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.group-active { box-shadow: inset 4px 0 0 var(--accent), var(--shadow); }
.group-active .group-count { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.group-inactive { box-shadow: inset 4px 0 0 var(--line), var(--shadow); }
.group-inactive .avatar { background: var(--surface-2); color: var(--muted); }

.client-link { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.client-link:hover { color: var(--accent-ink); }

/* Client information card */
.icard { padding: 0; overflow: hidden; }
.icard > .error, .icard > .row { margin-left: 16px; margin-right: 16px; }
.icard > .row:last-of-type { margin-bottom: 4px; }
.icard-note { margin: 8px 16px 16px; }
.icard-sec { border-bottom: 1px solid var(--line); }
.icard-head { display: flex; gap: 12px; align-items: center; margin: 0; padding: 8px 16px; background: var(--accent); color: #fff; font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; }
.icard-head span { min-width: 1.4em; font-weight: 800; }
.icard-row { display: flex; gap: 10px; align-items: center; padding: 6px 16px; border-top: 1px solid var(--line); }
.icard-row:first-of-type { border-top: 0; }
.icard-no { min-width: 1.4em; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.icard-label { flex: 0 0 auto; width: min(38%, 300px); font-weight: 700; font-size: .9rem; }
.icard-row input, .icard-row textarea { flex: 1; min-width: 0; resize: vertical; }
.icard-row > .muted { flex: 1; }
@media (max-width: 600px) { label.icard-row { flex-wrap: wrap; } label.icard-row .icard-label { width: auto; flex: 1; } label.icard-row textarea, label.icard-row > .muted { flex-basis: 100%; } }

/* LTV */
.ltv-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin: 4px 0 16px; padding: 14px 18px; border-radius: var(--radius); border: 1px dashed var(--accent); background: var(--accent-soft); }
.ltv-card .hero-label { color: var(--accent-ink); }
.ltv-value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ltv-card dl { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 0; }
.ltv-card dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.ltv-card dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.ltv-card > .muted { flex-basis: 100%; margin: 0; }
.best-info { margin: 8px 0 0; }

/* Lista zawodników: filtr trenera i grupowanie (właściciel) */
.list-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; margin: 0 0 14px; }
.list-toolbar .chips { margin-top: 2px; }
.group-trainer { box-shadow: inset 4px 0 0 var(--accent-ink), var(--shadow); }
.group-trainer .group-head h2 .avatar { width: 32px; height: 32px; font-size: .75rem; }
div.field { display: flex; flex-direction: column; gap: 5px; font-size: .8rem; font-weight: 600; color: var(--muted); }

/* Wiersz zawodnika – kolumny tematyczne */
.client-list li.cl-row { display: grid; grid-template-columns: minmax(170px, 1.3fr) repeat(4, minmax(0, 1fr)) auto; gap: 10px 16px; align-items: center; padding: 12px 0; }
.cl-who { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); text-decoration: none; }
.cl-who > span { display: grid; min-width: 0; }
.cl-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-cell { display: grid; gap: 1px; min-width: 0; padding-left: 12px; border-left: 3px solid var(--line); }
.cl-label { font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cl-main { font-weight: 700; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-sub { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-cell.tone-good { border-left-color: var(--good); }
.cl-cell.tone-warn { border-left-color: var(--warn-line); }
.cl-cell.tone-warn .cl-main { color: var(--warn); }
.cl-cell.tone-bad { border-left-color: var(--bad); }
.cl-cell.tone-bad .cl-main { color: var(--bad); }
.mini-bar { position: relative; display: block; height: 6px; margin: 3px 0 2px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.mini-bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--accent); }
.cl-cell.tone-bad .mini-bar > span { background: var(--bad); }
@media (max-width: 900px) {
  .client-list li.cl-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cl-who { grid-column: 1 / -1; }
  .client-list li.cl-row > .btn { grid-column: 1 / -1; justify-self: start; }
}
.cl-main { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Osiągnięcia */
.medal { width: 56px; height: 56px; flex: none; }
.medal.small { width: 36px; height: 36px; }
.medal .medal-ring { fill: var(--surface-2); stroke: var(--line); stroke-width: 2; stroke-dasharray: 4 3; }
.medal .medal-face { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.medal .medal-icon path { fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .6; }
.medal.earned .medal-ring { fill: var(--accent); stroke: var(--accent-ink); stroke-dasharray: none; }
.medal.earned .medal-face { fill: var(--accent-soft); stroke: var(--accent-ink); }
.medal.earned .medal-icon path { stroke: var(--accent-ink); opacity: 1; }
.ach-card { display: grid; gap: 14px; }
.ach-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.ach-streak { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.ach-earned { display: flex; flex-wrap: wrap; gap: 8px; }
.ach-mini { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 99px; background: var(--accent-soft); font-size: .8rem; font-weight: 700; color: var(--accent-ink); }
.ach-next { display: grid; gap: 10px; }
.ach-next .hero-label { color: var(--accent-ink); }
.ach-next-row { display: flex; gap: 12px; align-items: center; }
.ach-next-title { display: flex; justify-content: space-between; gap: 8px; }
.ach-next .goal-bar { height: 8px; margin: 4px 0 2px; }
.ach-intro { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.ach-intro > div { flex: 1 1 320px; }
.ach-intro p { margin: 6px 0 0; font-size: .9rem; }
.ach-intro .hero-label { color: var(--accent-ink); }
.ach-group h3 { margin: 18px 0 8px; }
.ach-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ach-badge { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 12px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.ach-badge.earned { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.ach-badge .goal-bar { width: 100%; height: 6px; }
.ach-new { text-align: center; padding: 8px 0; }
.ach-new-medals { display: flex; justify-content: center; gap: 8px; margin-bottom: 8px; }
.ach-new-medals .medal { width: 84px; height: 84px; }
.ach-hint { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-size: .85rem; }
@media (prefers-reduced-motion: no-preference) {
  .ach-new-medals .medal { animation: medal-pop .6s cubic-bezier(.2, 1.4, .4, 1) both; }
  @keyframes medal-pop { from { transform: scale(.4) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
}
.ex-dialog:focus, .ex-dialog:focus-visible { outline: none; }

/* Zdjęcie / awatar */
.avatar { overflow: hidden; }
.avatar.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.has-fig { background: var(--fig-bg); }
.avatar.has-fig .fig-avatar { width: 100%; height: 100%; background: none; border-radius: 0; }
button.user-chip { border: 0; background: none; padding: 4px 8px 4px 4px; border-radius: 99px; cursor: pointer; text-align: left; color: inherit; }
button.user-chip:hover { background: var(--surface-2); }
.avatar-btn { position: relative; border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.avatar-btn .avatar-edit { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; background: var(--accent); color: var(--on-accent); border: 2px solid var(--surface); }
.avatar-editor { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; margin-top: 14px; }
.avatar-preview { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--surface-2); border: 3px solid var(--accent); }
.avatar-preview .avatar { width: 100%; height: 100%; font-size: 2rem; }
.avatar-canvas { width: 100%; height: 100%; display: block; }
.avatar-src { flex: 1 1 260px; }
.avatar-src h3 { margin: 0 0 8px; }
.avatar-src label.btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.avatar-src label.btn { position: relative; }
.avatar-src label.btn:focus-within { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.avatar-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); max-height: 46vh; overflow: auto; padding: 2px; }
.avatar-opt { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; text-align: center; color: var(--text); }
.avatar-opt .avatar { width: 64px; height: 64px; background: var(--fig-bg); }
.avatar-opt .small { font-size: .7rem; line-height: 1.2; }
.avatar-opt:hover { border-color: var(--accent); }
.avatar-opt.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: var(--accent-soft); }
.avatar-grid + .error { margin-top: 8px; }
.avatar-editor + h3 + .row input[type=search] { flex: 1 1 220px; width: auto; }

/* Zgoda i konto */
.consent-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.consent-card { width: min(680px, 100%); display: grid; gap: 12px; }
.consent-card .logo { width: 56px; height: 56px; padding: 3px; }
.consent-card h1 { margin: 0; }
.privacy-info { font-size: .9rem; display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.privacy-info p { margin: 0; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
label.check input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--accent); }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.account-section { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.account-section h3 { margin: 0; }
.consent-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 14px; margin: 0 0 14px; border-radius: 12px; font-size: .88rem; background: var(--good-soft); border: 1px solid color-mix(in srgb, var(--good) 35%, transparent); }
.consent-bar.missing { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.consent-missing { color: var(--bad) !important; font-weight: 700; }

/* Instalacja na ekranie głównym */
.install-steps { margin: 0; padding-left: 20px; font-size: .88rem; display: grid; gap: 2px; }

/* Hierarchia tekstu */
.sec-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 1.15rem; }
.sec-title .sec-ic { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.sec-title .sec-ic .icon { width: 18px; height: 18px; }
.sec-title .group-count { font-size: .75rem; }
.group-head .sec-title { margin: 0; }
.stat-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-trio div { display: grid; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.stat-trio b { font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-trio span { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat-trio div:last-child { background: var(--accent-soft); }
.stat-trio div:last-child b { color: var(--accent-ink); }
.pass-valid { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.pass-valid .icon { width: 18px; height: 18px; color: var(--accent-ink); }
.log-title { font-size: 1rem; }
.log-metrics { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .85rem; color: var(--muted); margin-top: 2px; }
.log-metrics b { color: var(--text); font-size: 1rem; font-variant-numeric: tabular-nums; }
.show-more { margin-top: 10px; }
.legend-box { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.legend-box summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-weight: 700; font-size: .88rem; color: var(--accent-ink); }
.legend-box summary .icon { width: 18px; height: 18px; }
.legend-box dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; padding: 0 14px 14px; font-size: .86rem; }
.legend-box dt { font-weight: 700; }
.legend-box dd { margin: 0; color: var(--muted); }
.legend-box dd b { color: var(--text); }
.ex-plain { font-weight: 600; }
.m-only { display: none; }
.plan-table td.v-big { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Plan na telefonie: każde ćwiczenie jako karta z opisanymi wartościami */
@media (max-width: 720px) {
  .plan-table thead { display: none; }
  .plan-table, .plan-table tbody { display: block; }
  .plan-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .plan-table tbody tr:hover td { background: none; }
  .plan-table td { border: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; background: none !important; box-shadow: none !important; }
  .plan-table td[data-label]::before { content: attr(data-label); font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
  .plan-table td.is-empty { display: none; }
  .plan-table td.ex-code { display: none; }
  .plan-table td.ex-name-cell { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 10px; font-size: 1.02rem; }
  .plan-table td.ex-name-cell .m-only { display: inline-block; }
  .plan-table td.ex-name-cell .ex-link, .plan-table td.ex-name-cell .ex-plain { font-weight: 700; font-size: 1.02rem; text-align: left; }
  .plan-table td.v-big { font-size: 1.15rem; }
  .plan-table td.ex-notes, .plan-table td.rpe-cell { grid-column: 1 / -1; }
  .plan-table td.rpe-cell { flex-direction: row; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px dashed var(--line); }
  .plan-table td.rpe-cell .rpe-select { max-width: 7em; }
  .plan-table tr.in-circuit { border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
  .plan-table tr.circuit-head { display: block; padding: 4px 2px; margin: 4px 0 6px; border: 0; background: none; }
  .plan-table tr.circuit-head td { display: block; padding: 0; }
  .plan-table tr.circuit-head td::before { content: none; }
  .table-wrap:has(.plan-table) { overflow: visible; }
}

@media (max-width: 720px) {
  .plan-table { width: 100%; table-layout: fixed; }
  .plan-table tr.circuit-head td { white-space: normal; font-size: .78rem; line-height: 1.4; }
}
.ach-mini.more { border: 0; cursor: pointer; padding: 4px 14px; font: inherit; font-size: .8rem; font-weight: 700; }
@media (max-width: 720px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-grid .kpi { padding: 12px; }
  .kpi-grid .kpi .value { font-size: 1.5rem; }
  .kpi-grid .kpi-top { flex-direction: column; align-items: flex-start; gap: 4px; }
  .kpi-grid .kpi-foot { font-size: .68rem; }
}

/* Odznaki – styl gry */
.medal { width: 60px; height: 60px; flex: none; overflow: visible; }
.medal.small { width: 38px; height: 38px; }
.medal.earned { filter: drop-shadow(0 3px 6px rgb(0 0 0 / .22)); }
.medal .m-shine { fill: #fff; opacity: .28; }
.medal .m-icon path { fill: none; stroke: #fff; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.medal .m-stars polygon { fill: #fff; stroke: rgb(0 0 0 / .25); stroke-width: .6; }
.medal.locked .m-rim { fill: var(--surface-2); stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 3 2.5; }
.medal.locked .m-face { fill: var(--line); }
.medal.locked .m-icon path { stroke: var(--muted); opacity: .7; }
.medal.locked .m-stars polygon { fill: var(--surface-2); stroke: var(--muted); opacity: .6; }
.medal.medal-ring, .medal .medal-ring, .medal .medal-face { display: none; }
.ach-level { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 260px; }
.lvl { position: relative; width: 52px; height: 52px; flex: none; filter: drop-shadow(0 4px 8px rgb(226 65 42 / .35)); }
.lvl.big { width: 68px; height: 68px; }
.lvl svg { width: 100%; height: 100%; display: block; }
.lvl .m-shine { fill: #fff; opacity: .3; }
.lvl > span { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.25rem; text-shadow: 0 1px 2px rgb(0 0 0 / .3); }
.ach-lvl-title { display: flex; align-items: baseline; gap: 10px; }
.ach-lvl-title strong { font-size: 1.15rem; }
.xp { font-weight: 700; font-size: .8rem; color: #fff; background: linear-gradient(90deg, #ffb15c, #e2412a); padding: 1px 8px; border-radius: 99px; }
.xp-bar { display: block; height: 8px; margin: 6px 0 3px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.xp-bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ffd84a, #ff6a00, #e2412a); }
.ach-mini { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.tier-tag { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 99px; color: #fff; }
.tier-tag.tier-bronze { background: linear-gradient(90deg, #d08a52, #97501f); }
.tier-tag.tier-silver { background: linear-gradient(90deg, #b9c3cf, #6f7d8d); }
.tier-tag.tier-gold { background: linear-gradient(90deg, #f2b632, #c27a00); }
.tier-tag.tier-platinum { background: linear-gradient(90deg, #64c8e0, #2a86a3); }
.tier-tag.tier-legend { background: linear-gradient(90deg, #a36cf0, #6024c8); }
.ach-badge:not(.earned) .tier-tag { filter: grayscale(.85); opacity: .7; }
.ach-badge.earned { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.ach-badge.earned.g-trainings { box-shadow: inset 0 3px 0 #e2412a, var(--shadow); }
.ach-badge.earned.g-tonnage { box-shadow: inset 0 3px 0 #2c3cb8, var(--shadow); }
.ach-badge.earned.g-meso { box-shadow: inset 0 3px 0 #0f7f62, var(--shadow); }
.ach-badge.earned.g-goals { box-shadow: inset 0 3px 0 #c2185b, var(--shadow); }
.ach-badge.earned.g-streak { box-shadow: inset 0 3px 0 #ff6a00, var(--shadow); }
.badge.got { background: var(--good-soft); color: var(--good); }
.ach-new-medals { position: relative; padding: 18px 0; }
.ach-new-medals .medal { position: relative; width: 96px; height: 96px; }
.burst { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgb(255 176 60 / .35) 0 10deg, transparent 10deg 24deg); mask: radial-gradient(circle, #000 35%, transparent 70%); -webkit-mask: radial-gradient(circle, #000 35%, transparent 70%); }
@media (prefers-reduced-motion: no-preference) {
  .burst { animation: burst-spin 12s linear infinite; }
  @keyframes burst-spin { to { transform: rotate(360deg); } }
  .ach-card .medal.earned:hover { transform: translateY(-2px) scale(1.06); transition: transform .2s; }
}
.medal-preview { display: inline-flex; opacity: .55; filter: grayscale(.55); }
.ach-next-row:hover .medal-preview { opacity: .9; filter: none; transition: opacity .2s, filter .2s; }
.tier-tag.tier-diamond { background: linear-gradient(90deg, #5d86ff, #2a43c9); }
.tier-tag.tier-legend { background: linear-gradient(90deg, #d14bd9, #6b17c4); }

/* Wiadomości (czat z trenerem) */
.unread { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 99px; background: #e2412a; color: #fff; font-size: .68rem; font-weight: 700; line-height: 1; vertical-align: middle; }
.unread[hidden] { display: none !important; }
.mainnav a, .tabs .tab { position: relative; }
/* "Something new" in a client's tab (src/news.js) – until the tab is opened. */
.news-dot { flex: none; width: 9px; height: 9px; margin-left: 2px; border-radius: 50%; background: #e2412a; box-shadow: 0 0 0 2px var(--surface); }
.news-dot[hidden] { display: none !important; }
.topbar .brand { position: relative; }
.topbar .brand .news-dot { position: absolute; top: -1px; left: 31px; margin: 0; }
.btn .unread { margin-left: 2px; }
.chat { display: flex; flex-direction: column; gap: 10px; padding: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-head .grow { flex: 1; min-width: 0; }
.chat-back { display: none; }
.chat-list { display: flex; flex-direction: column; gap: 6px; padding: 4px 16px 8px; overflow-y: auto; height: min(56vh, 560px); overscroll-behavior: contain; }
.chat-more { align-self: center; margin-bottom: 6px; }
.chat-empty { padding: 4px 16px; font-size: .9rem; }
.msg-day { align-self: center; margin: 10px 0 4px; font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.msg { align-self: flex-start; max-width: min(78%, 520px); padding: 8px 12px 6px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); border: 1px solid var(--line); }
.msg.mine { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.msg-who { display: block; font-size: .72rem; font-weight: 700; color: var(--accent-ink); margin-bottom: 2px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.msg-time { display: block; text-align: right; font-size: .68rem; color: var(--muted); margin-top: 2px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 0 16px 14px; }
.chat-form textarea { flex: 1; resize: none; min-height: 44px; max-height: 160px; border-radius: 22px; padding: 11px 16px; line-height: 1.35; }
.chat-send { border-radius: 99px; min-height: 44px; }
.chat-count { padding: 0 16px 10px; margin-top: -10px; text-align: right; }
.chat-count:empty, .chat .error:empty { display: none; }
.chat .error { margin: 0 16px; }
.chat-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.thread-side { padding: 12px; display: flex; flex-direction: column; gap: 10px; max-height: calc(56vh + 230px); }
.thread-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.thread { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 12px; color: var(--text); text-decoration: none; }
.thread:hover { background: var(--surface-2); }
.thread[aria-current="true"] { background: var(--accent-soft); }
.thread-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.thread-top { display: flex; justify-content: space-between; gap: 8px; }
.thread-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-pick { display: grid; place-items: center; gap: 6px; min-height: 240px; text-align: center; }
.chat-pick .icon { width: 36px; height: 36px; color: var(--accent-ink); }
.chat-toast { position: fixed; z-index: 50; right: 16px; bottom: 16px; display: flex; gap: 10px; align-items: flex-start; max-width: min(360px, calc(100vw - 32px)); padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); text-align: left; cursor: pointer; font: inherit; animation: toast-in .25s ease-out; }
.chat-toast .icon { flex: none; color: var(--accent-ink); }
.chat-toast > span { display: flex; flex-direction: column; gap: 2px; font-size: .85rem; min-width: 0; overflow-wrap: anywhere; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .chat-toast { animation: none; } }
@media (max-width: 720px) {
  .mainnav .news-dot { position: absolute; top: 4px; left: calc(50% + 8px); margin: 0; }
  .mainnav .unread, .tabs.primary-tabs .unread { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; min-width: 16px; height: 16px; font-size: .62rem; padding: 0 4px; }
  .chat-layout { grid-template-columns: minmax(0, 1fr); } /* minmax: a long last message must not widen the list */
  .chat-layout.has-open .thread-side { display: none; }
  .chat-layout:not(.has-open) .thread-pane { display: none; }
  .hide-phone { display: none; }
  .chat-back { display: inline-grid; place-items: center; }
  .chat-list { height: calc(100dvh - 380px); min-height: 200px; }
  /* Sized to the screen by fitChat (app.js): the list takes what is left above the composer. */
  .chat.fit .chat-list { height: auto; min-height: 0; flex: 1; }
  .chat.fit .chat-form { padding-bottom: 12px; }
  /* Narrow screens: the send button shows only its icon (its label stays for screen readers via aria-label). */
  .chat-send span { display: none; }
  .chat-send { width: 44px; padding: 0; justify-content: center; flex: none; }
  .chat-form textarea { min-width: 0; }
  .thread-side { max-height: none; }
  .chat-toast { bottom: calc(84px + env(safe-area-inset-bottom)); right: 12px; left: 12px; max-width: none; }
  .msg { max-width: 86%; }
}

/* Ustawienia */
.settings-grid { display: grid; gap: 10px; max-width: 760px; }
/* Settings = a list of options; a click opens one (the others close). */
.settings-card { display: block; margin: 0; padding: 0; overflow: hidden; scroll-margin-top: 80px; }
.settings-card > :not(summary) { margin: 0 18px 14px; }
.settings-card > summary + * { margin-top: 2px; }
.settings-title { display: flex; align-items: center; gap: 12px; margin: 0; padding: 14px 18px; font-size: 1rem; font-weight: 700; cursor: pointer; list-style: none; border-radius: inherit; }
.settings-title::-webkit-details-marker { display: none; }
.settings-title:hover { background: var(--surface-2); }
.settings-title:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.settings-ic { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.settings-ic .icon { width: 19px; height: 19px; }
.settings-title > .icon { width: 18px; height: 18px; color: var(--muted); transition: transform .2s; }
.settings-card[open] > .settings-title > .icon { transform: rotate(90deg); }
.settings-card[open] > .settings-title { border-bottom: 1px solid var(--line); margin-bottom: 14px; border-radius: 0; }
@media (prefers-reduced-motion: reduce) { .settings-title > .icon { transition: none; } }
.settings-form { display: grid; gap: 10px; }
.settings-card .consent-bar { margin: 0; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); justify-self: start; }
.seg button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: .85rem; padding: 7px 14px; border-radius: 99px; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .15); }
.consent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.consent-list li { display: flex; align-items: center; gap: 10px; }
.consent-list a { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.chip-warn { border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-soft); color: var(--bad); font: inherit; font-size: .8rem; font-weight: 700; padding: 6px 12px; border-radius: 99px; cursor: pointer; }
a.user-chip { text-decoration: none; padding: 4px 8px 4px 4px; border-radius: 99px; color: inherit; }
a.user-chip:hover { background: var(--surface-2); }
a.icon-btn { text-decoration: none; }
a.icon-btn[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }

/* Kolory akcentu do wyboru (Ustawienia → Wygląd). Domyślny pomarańcz z logo jest w :root powyżej. */
:root[data-accent="berry"] { --accent-hero: #f490ba; --accent: #c7366f; --accent-ink: #a8285c; --accent-soft: #fce8f0; --on-accent: #ffffff; }
:root[data-accent="lavender"] { --accent-hero: #c9a8f7; --accent: #8a4fd8; --accent-ink: #6b35b5; --accent-soft: #f1e9fd; --on-accent: #ffffff; }
:root[data-accent="teal"] { --accent-hero: #5fd3cf; --accent: #0b7f80; --accent-ink: #0a6d6e; --accent-soft: #e2f4f3; --on-accent: #ffffff; }
:root[data-accent="orange"] { --accent-hero: #fb902a; --accent: #fb902a; --accent-ink: #a85400; --accent-soft: #fff1e3; --on-accent: #1f1c1a; }
@media (prefers-color-scheme: dark) {
  :root[data-accent="berry"]:not([data-theme="light"]) { --accent-hero: #f28ab3; --accent: #ec6a9f; --accent-ink: #f28ab3; --accent-soft: #3a1a28; --on-accent: #1a0f14; }
  :root[data-accent="lavender"]:not([data-theme="light"]) { --accent-hero: #c4a3f7; --accent: #b48cf2; --accent-ink: #c4a3f7; --accent-soft: #2a1f3d; --on-accent: #150f1f; }
  :root[data-accent="teal"]:not([data-theme="light"]) { --accent-hero: #5fd3cf; --accent: #3cc4c0; --accent-ink: #5fd3cf; --accent-soft: #12302f; --on-accent: #071615; }
  :root[data-accent="orange"]:not([data-theme="light"]) { --accent-hero: #fb902a; --accent: #fb902a; --accent-ink: #fb902a; --accent-soft: #3a2612; --on-accent: #1a1410; }
}
:root[data-accent="berry"][data-theme="dark"] { --accent-hero: #f28ab3; --accent: #ec6a9f; --accent-ink: #f28ab3; --accent-soft: #3a1a28; --on-accent: #1a0f14; }
:root[data-accent="lavender"][data-theme="dark"] { --accent-hero: #c4a3f7; --accent: #b48cf2; --accent-ink: #c4a3f7; --accent-soft: #2a1f3d; --on-accent: #150f1f; }
:root[data-accent="teal"][data-theme="dark"] { --accent-hero: #5fd3cf; --accent: #3cc4c0; --accent-ink: #5fd3cf; --accent-soft: #12302f; --on-accent: #071615; }
:root[data-accent="orange"][data-theme="dark"] { --accent-hero: #fb902a; --accent: #fb902a; --accent-ink: #fb902a; --accent-soft: #3a2612; --on-accent: #1a1410; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.swatches button[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.swatch { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgb(255 255 255 / .35); }
.seg.stack { display: grid; justify-self: stretch; border-radius: 16px; }
.seg.stack button { text-align: left; border-radius: 12px; }

/* Analityka (właściciel) */
.an-top { justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.an-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.an-dates input { width: auto; padding: 7px 10px; }
.an-kpis { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.an-kpis .kpi .value { font-size: 1.6rem; }
.kpi.tone-bad .value { color: var(--bad); }
.kpi.tone-warn .value { color: var(--warn); }
.an-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 16px; align-items: start; }
.an-full { grid-template-columns: 1fr; margin-top: 16px; }
.an-card { display: grid; gap: 12px; margin: 0; min-width: 0; }
.an-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.an-sub { margin: 6px 0 0; font-size: .9rem; }
.an-chart svg { width: 100%; height: auto; display: block; }
.an-gridline { stroke: var(--line); stroke-width: 1; }
.an-axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.bar-a { fill: var(--accent); }
.bar-b { fill: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.bar-bad { fill: color-mix(in srgb, var(--bad) 75%, var(--surface)); }
.an-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.an-legend span { display: inline-flex; align-items: center; gap: 6px; }
.an-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.an-legend i.bar-a { background: var(--accent); } .an-legend i.bar-b { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); } .an-legend i.bar-bad { background: color-mix(in srgb, var(--bad) 75%, var(--surface)); }
.an-rank { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.an-rank li { display: flex; justify-content: space-between; gap: 8px; }
.an-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.an-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.an-heat-wrap, .an-table-wrap { overflow-x: auto; }
.an-heat { border-collapse: separate; border-spacing: 3px; font-size: .72rem; font-variant-numeric: tabular-nums; }
.an-heat th { color: var(--muted); font-weight: 600; padding: 0 2px; text-align: center; }
.an-heat td { width: 26px; height: 24px; text-align: center; border-radius: 5px; background: var(--surface-2); color: var(--text); }
.an-heat td.on { background: color-mix(in srgb, var(--accent) calc(var(--heat) * 100%), var(--surface-2)); color: var(--on-accent); font-weight: 700; }
.an-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.an-table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.an-table td { padding: 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.an-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.an-facts div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.an-facts strong { font-size: 1.3rem; }
.an-facts span { font-size: .78rem; color: var(--muted); }
@media (max-width: 720px) {
  .an-table thead { display: none; }
  .an-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .an-table td { border: 0; padding: 2px 0; }
  .an-table td::before { content: attr(data-label); display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .an-table td:first-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .an-kpis .kpi { padding: 12px; }
  .an-kpis .kpi .value { font-size: 1.25rem; }
  .an-axis { font-size: 19px; }
  .an-filters .seg { justify-self: stretch; }
}
@media (max-width: 720px) {
  .an-filters { display: grid; grid-template-columns: 1fr; width: 100%; }
  .an-filters .seg { display: grid; grid-template-columns: repeat(4, auto); border-radius: 16px; }
  .an-filters .seg button { padding: 7px 8px; font-size: .78rem; }
  .an-dates { display: flex; flex-wrap: nowrap; }
  .an-dates input { flex: 1; min-width: 0; }
}

/* Bezpieczeństwo: sesje, dziennik, ostrzeżenie o nowym urządzeniu */
.sess-list, .sec-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sess-list li, .sec-log li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.sess-list .badge, .sec-log .badge { margin-left: 8px; }
.sec-log li.is-new { border-color: var(--warn-line); background: color-mix(in srgb, var(--warn-line) 12%, var(--surface)); }
.sec-log li.is-fail strong { color: var(--bad); }
.warn-badge { background: color-mix(in srgb, var(--warn-line) 25%, var(--surface)); color: var(--warn); }
.nowrap { white-space: nowrap; }
.sec-banner { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; padding: 14px 16px; margin-bottom: 16px; border-radius: 14px; border: 1px solid var(--warn-line); background: color-mix(in srgb, var(--warn-line) 14%, var(--surface)); }
.sec-banner > .icon { color: var(--warn); flex: none; }
.sec-banner ul { margin: 6px 0; padding-left: 18px; font-size: .88rem; }
.banner-wrap { max-width: 1080px; margin: 0 auto; padding: 20px 20px 0; }
.banner-wrap .sec-banner { margin: 0; }
@media (max-width: 720px) { .banner-wrap { padding: 14px 14px 0; } }

/* Kalendarz: widoki dzień / tydzień / miesiąc / rok */
.cal-title { text-transform: none; }
.cal-title::first-letter { text-transform: uppercase; }
.cal-views { justify-self: auto; }
.cal-nav { gap: 8px; }
.btn.primary-soft { border-color: var(--accent); color: var(--accent-ink); }
.cal-hint { margin: -6px 0 10px; }
button.cal-day { border: 0; background: none; color: inherit; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 600; }
button.cal-day:hover { background: var(--accent-soft); }
/* siatka godzin */
.tg { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.tg-head { display: grid; grid-template-columns: 52px repeat(var(--cols), minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tg-day { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 6px 2px; border: 0; background: none; color: var(--muted); font: inherit; font-size: .72rem; text-transform: uppercase; cursor: pointer; }
.tg-day b { font-size: 1.05rem; color: var(--text); text-transform: none; }
.tg-day.is-today b { background: var(--accent); color: var(--on-accent); border-radius: 99px; min-width: 30px; padding: 1px 6px; }
.tg-day:hover { background: var(--accent-soft); }
.tg-scroll { max-height: min(68vh, 760px); overflow-y: auto; overscroll-behavior: contain; }
.tg-body { display: grid; grid-template-columns: 52px minmax(0, 1fr); }
.tg-hours { position: relative; border-right: 1px solid var(--line); }
.tg-hours span { position: absolute; right: 6px; transform: translateY(-50%); font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tg-hours span:first-child { transform: none; }
.tg-cols { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
.tg-col { position: relative; border-left: 1px solid var(--line);
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px), linear-gradient(to bottom, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px);
  background-size: 100% 66px, 100% 33px; }
.tg-col:first-child { border-left: 0; }
.tg-col.is-today { background-color: color-mix(in srgb, var(--accent) 5%, transparent); }
.tg-slot { position: absolute; left: 0; right: 0; border: 0; background: transparent; padding: 0 6px; text-align: left; cursor: pointer; color: transparent; font: inherit; font-size: .72rem; font-weight: 700; }
.tg-slot:hover, .tg-slot:focus-visible { background: var(--accent-soft); color: var(--accent-ink); outline: 1px dashed var(--accent); outline-offset: -1px; border-radius: 6px; }
.tg-ev { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; overflow: hidden; padding: 3px 6px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-size: .72rem; line-height: 1.25; text-align: left; box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
button.tg-ev { cursor: pointer; }
.tg-ev.short { flex-direction: row; gap: 6px; align-items: center; }
.tg-ev-time { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tg-ev-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tg-ev-meta { opacity: .8; white-space: nowrap; }
.tg-ev.status-planned { background: var(--surface); color: var(--text); border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent), 0 1px 2px rgb(0 0 0 / .12); }
.tg-ev.status-done { background: var(--accent); color: var(--on-accent); }
.tg-ev.status-cancelled { background: var(--surface-2); color: var(--muted); border-color: var(--line); text-decoration: line-through; }
.tg-ev.no-pass { border-style: dashed; border-color: var(--bad); box-shadow: inset 3px 0 0 var(--bad); }
.tg-ev.dragging { z-index: 5; opacity: .85; cursor: grabbing; box-shadow: 0 8px 20px -6px rgb(0 0 0 / .35); }
.tg-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 3; pointer-events: none; }
.tg-now::before { content: ''; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
/* rok */
.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 18px; }
.ym-title { border: 0; background: none; padding: 0 0 6px; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; }
.ym-title:hover { color: var(--accent-ink); }
.ym-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ym-head { font-size: .62rem; color: var(--muted); text-align: center; }
.ym-day { aspect-ratio: 1; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: .72rem; cursor: pointer; padding: 0; }
.ym-day:hover { outline: 1px solid var(--accent); }
.ym-day.has.n1 { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.ym-day.has.n2 { background: color-mix(in srgb, var(--accent) 60%, transparent); }
.ym-day.has.n3 { background: var(--accent); color: var(--on-accent); }
.ym-day.is-today { box-shadow: inset 0 0 0 2px var(--text); font-weight: 700; }
/* kafelki w formularzu treningu */
.training-form { display: grid; gap: 14px; }
.tile-field { display: grid; gap: 6px; }
.tile-label { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tile-label label { text-transform: none; letter-spacing: 0; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.tile-other { width: auto; padding: 5px 8px; font-size: .85rem; }
.tile-week { display: flex; align-items: center; gap: 6px; }
.tile-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tile-row.days { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; max-height: 236px; overflow-y: auto; padding: 2px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 44px; padding: 6px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.tile b { font-size: .92rem; font-variant-numeric: tabular-nums; }
.tile span { font-size: .66rem; color: var(--muted); line-height: 1.2; text-align: center; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.tile:hover { border-color: var(--accent); }
.tile.is-today { box-shadow: inset 0 -3px 0 var(--accent); }
.tile.busy { background: var(--surface-2); border-style: dashed; }
.tile.busy span { color: var(--warn); }
.tile.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tile.on span { color: inherit; opacity: .85; }
@media (max-width: 720px) {
  .cal-toolbar { display: grid; grid-template-columns: 1fr; }
  .cal-toolbar .spacer { display: none; }
  .cal-views { display: grid; grid-template-columns: repeat(4, 1fr); }
  .cal-nav { justify-content: space-between; }
  .tg-head, .tg-body { grid-template-columns: 40px repeat(var(--cols, 1), minmax(0, 1fr)); }
  .tg-body { grid-template-columns: 40px minmax(0, 1fr); }
  .tg-ev { padding: 2px 4px; font-size: .66rem; }
  .tile-row.days .tile span { font-size: .6rem; }
  .tile-week .icon-btn { width: 30px; height: 30px; }
}
.tile-grid { position: relative; }
@media (max-width: 720px) {
  .tile-grid { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); max-height: 200px; }
  .tile { min-height: 40px; padding: 4px 2px; }
  .tile b { font-size: .85rem; }
  .tile-row.days { gap: 4px; }
}
.nick-form { display: grid; gap: 6px; }
.nick-form .row { flex-wrap: nowrap; }
.nick-form input { flex: 1; min-width: 0; }
.privacy-info { gap: 10px; }
.pi-sec { display: grid; gap: 4px; }
.pi-sec h4 { margin: 0; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-ink); }
.pi-sec ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.consent-card .privacy-info { max-height: 46vh; overflow-y: auto; }
.cred-list { display: grid; gap: 8px; margin: 12px 0; }
.cred-list div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.cred-list dt { color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; align-self: center; }
.cred-list dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; word-break: break-all; }
.cred-pass { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.meas-group { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 14px; margin: 10px 0 0; }
.meas-group legend { padding: 0 6px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-ink); }
.meas-group .grid { align-items: end; }

/* Progres: pomiary z wagi i obwody ciała */
.body-part { margin-bottom: 26px; }
.body-part > .group-head { margin-bottom: 10px; }
.circ-layout { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.circ-layout .card { margin: 0; }
.circ-card { padding: 14px; }
.circ-fig { max-width: 420px; margin: 0 auto; }
.circ-line { stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 3 2; stroke-linecap: round; }
.circ-lead { stroke: var(--muted); stroke-width: .6; }
.circ-dot { fill: var(--accent); }
.circ-name { font-size: 7px; font-weight: 700; fill: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.circ-val { font-size: 8.5px; font-weight: 700; fill: var(--text); font-variant-numeric: tabular-nums; }
.circ-down { fill: var(--good); font-size: 7px; }
.circ-up { fill: var(--warn); font-size: 7px; }
@media (max-width: 820px) { .circ-layout { grid-template-columns: 1fr; } }
.circ-neutral { fill: var(--muted); font-size: 7px; }
.circ-fig { display: block; width: 100%; height: auto; }
.circ-body { fill: none; stroke: var(--text); stroke-width: 1.3; stroke-linejoin: round; opacity: .75; }
.row-actions { white-space: nowrap; } .row-actions .btn + .btn { margin-left: 10px; }

/* Plan: the client's entry after a training day (session RPE + note) */
.day-entry { margin: 10px 0 18px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 8px; }
.day-entry.readonly { background: transparent; border: 1px dashed var(--line); }
.day-entry-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.day-entry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 12px; }
.day-entry .field { margin: 0; }
.day-entry select, .day-entry input[type=date] { max-width: 100%; min-width: 0; }

/* Cardio exercises (e.g. treadmill): time, intensity (lvl), incline instead of sets × reps × load */
.cardio-cell { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; }
.cardio-val { display: inline-flex; gap: 6px; align-items: baseline; }
@media (max-width: 720px) { .plan-table td.cardio-td { grid-column: 1 / -1; } }
.cardio-val small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.ex-row .cardio-only, .log-edit-item .cardio-only { display: none; }
.ex-row.is-cardio .cardio-only, .log-edit-item.is-cardio .cardio-only { display: revert; }
.log-edit-item.is-cardio .cardio-only.log-cardio-edit { display: grid; }
.ex-row.is-cardio .strength-only, .log-edit-item.is-cardio .strength-only { display: none; }
.ex-row.is-cardio { grid-template-columns: 1fr 4.5em 2fr 1fr 1fr 1fr auto; }
@media (max-width: 720px) { .ex-row.is-cardio { grid-template-columns: 1fr 1fr; } }
.log-cardio-edit { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px 10px; margin: 6px 0; }
.log-cardio-edit .field { margin: 0; }
.we-cardio { display: flex; gap: 6px; }
.we-cardio input { min-width: 6em; }

/* Trainings done alone (entered by the client) */
.chip.solo, .tg-ev.solo { background: var(--accent-soft); color: var(--accent-ink); border: 1px dashed var(--accent); }

/* Training videos (YouTube, loaded after a click) */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 18px; }
.video-card { display: grid; gap: 8px; align-content: start; }
.video-card h3 { margin: 0; font-size: 1rem; }
.video-card p { margin: 0; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: var(--hero-bg); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 0; cursor: pointer;
  background: var(--hero-bg); color: var(--hero-text); font: inherit; font-weight: 700; }
.video-play .icon, .video-play svg { width: 40px; height: 40px; }
.video-play:hover, .video-play:focus-visible { background: color-mix(in srgb, var(--hero-bg) 80%, var(--accent)); }

/* Menu with more than 5 items (staff, client): on a phone the extra ones are under „Więcej” */
.nav-more, .nav-more-menu { display: none; }
@media (max-width: 720px) {
  .mainnav .nav-extra { display: none; }
  .mainnav .nav-more { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 2px; border: 0; background: none;
    color: var(--muted); font: inherit; font-weight: 600; font-size: .68rem; cursor: pointer; border-radius: 12px; }
  .mainnav .nav-more .icon { width: 22px; height: 22px; stroke-width: 3; }
  .mainnav .nav-more[aria-current="page"], .mainnav .nav-more[aria-expanded="true"] { color: var(--accent-ink); }
  .mainnav .nav-more[aria-current="page"] .icon { background: var(--accent-soft); border-radius: 99px; width: 48px; padding: 0 13px; }
  .mainnav .nav-more-menu:not([hidden]) { display: grid; position: absolute; right: 8px; bottom: calc(100% + 8px); min-width: 190px; padding: 6px; gap: 2px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
  .mainnav .nav-more-menu a { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 10px 12px; font-size: .9rem; color: var(--text); }
  .mainnav .nav-more-menu a .icon { width: 20px; height: 20px; background: none; padding: 0; }
  .mainnav .nav-more-menu a[aria-current="page"] { background: var(--accent-soft); }
  .mainnav .nav-more { position: relative; }
  .mainnav .nav-more-menu .news-dot, .mainnav .nav-more-menu .unread { position: static; margin-left: auto; }
}

/* Password field with the show / hide button (eye) */
.pw-field { position: relative; display: block; }
.pw-field input { width: 100%; padding-right: 48px; }
.pw-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center; width: 38px; height: 38px;
  border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.pw-toggle:hover, .pw-toggle[aria-pressed="true"] { color: var(--accent-ink); }
.pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pw-toggle .icon { width: 20px; height: 20px; }

/* Locked (approved) training log */
.lock-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 12px; }
.lock-note .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.lock-box { display: grid; gap: 8px; justify-items: start; }

/* Header on tablets / small laptops (721–1439 px): it did not fit (page scrolled sideways). Up to 1439: logo and
   avatar without text; up to 1180: menu items as icon + small label, extra items under „Więcej” (dropdown). */
@media (min-width: 721px) and (max-width: 1439px) {
  .topbar .brand-name, .topbar .user-name { display: none; }
  .user-chip { margin-right: 0; }
}
@media (min-width: 721px) and (max-width: 1180px) {
  .mainnav { position: relative; margin-left: 8px; gap: 0; }
  .mainnav a, .mainnav .nav-more { flex-direction: column; gap: 2px; padding: 5px 9px; font-size: .7rem; border-radius: 12px; }
  .mainnav a .icon, .mainnav .nav-more .icon { width: 20px; height: 20px; }
  .mainnav .nav-extra { display: none; }
  .mainnav .nav-more { display: flex; align-items: center; justify-content: center; position: relative; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: .7rem; cursor: pointer; }
  .mainnav .nav-more:hover, .mainnav .nav-more[aria-expanded="true"] { color: var(--text); background: var(--surface-2); }
  .mainnav .nav-more[aria-current="page"] { color: var(--text); background: var(--accent-soft); }
  .mainnav .nav-more-menu:not([hidden]) { display: grid; position: absolute; z-index: 20; right: 0; top: calc(100% + 8px); min-width: 200px; padding: 6px; gap: 2px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
  .mainnav .nav-more-menu a { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 10px 12px; font-size: .9rem; color: var(--text); border-radius: 10px; }
  .mainnav .nav-more-menu a[aria-current="page"] { background: var(--accent-soft); }
  .mainnav .unread { position: absolute; top: 1px; left: calc(50% + 6px); margin: 0; min-width: 16px; height: 16px; font-size: .62rem; padding: 0 4px; }
  .mainnav .news-dot { position: absolute; top: 3px; left: calc(50% + 8px); margin: 0; }
  .mainnav .nav-more-menu .news-dot, .mainnav .nav-more-menu .unread { position: static; margin-left: auto; }
}

/* ===================== Odświeżona szata graficzna (futurystyczna) =====================
   Tylko wygląd – działanie bez zmian. Stan sprzed zmiany: gałąź git „przed-zmiana-wizualna”. */

/* Tło: siatka kropek + poświata akcentu (nieruchoma przy przewijaniu). */
body {
  background-color: var(--bg);
  background-image: radial-gradient(circle at 85% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 42%),
    radial-gradient(var(--dots) 1px, transparent 1px);
  background-size: 100% 100%, 22px 22px; background-attachment: fixed;
}

/* Nagłówki i liczby: Space Grotesk. */
h1, .hero h1, .settings-title, .sec-title, .kpi .value, .hero-when, .ring-num, .goal-pct, .goal-vals b, .xp, .ach-lvl-title strong,
.cal-toolbar h2, .tg-day b, .cal-day, .date-tile, .week-count, .seq-pill, .chip-time, .tg-ev-time { font-family: var(--font-display); }
h1 { letter-spacing: -.025em; }

/* Logo bez tła: jasny / ciemny wariant według motywu. */
.brand-logo { display: inline-flex; flex: none; }
.brand-logo img { display: block; height: 100%; width: auto; }
.brand-logo .logo-on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo .logo-on-light { display: none; }
  :root:not([data-theme="light"]) .brand-logo .logo-on-dark { display: block; }
}
:root[data-theme="dark"] .brand-logo .logo-on-light { display: none; }
:root[data-theme="dark"] .brand-logo .logo-on-dark { display: block; }
.topbar .brand .brand-logo { height: 32px; }
.topbar .brand-name { font-weight: 700; letter-spacing: -.01em; }
.brand-accent { color: var(--accent-ink); }

/* Nagłówek: półprzezroczysty, cienka linia. */
.topbar { background: color-mix(in srgb, var(--surface) 80%, transparent); border-bottom-color: var(--line); }

/* Karty: cienka ramka, w ciemnym motywie lekko przezroczyste. */
.card, .kpi, .goal-card { border-color: var(--line); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card, :root:not([data-theme="light"]) .kpi, :root:not([data-theme="light"]) .goal-card {
    background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: inset 0 1px 0 rgb(255 255 255 / .04), var(--shadow); }
}
:root[data-theme="dark"] .card, :root[data-theme="dark"] .kpi, :root[data-theme="dark"] .goal-card {
  background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: inset 0 1px 0 rgb(255 255 255 / .04), var(--shadow); }

/* Przyciski główne: gradient akcentu i poświata. */
.btn.primary { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent) 45%, color-mix(in srgb, var(--accent) 85%, #000));
  border-color: transparent; box-shadow: 0 8px 22px -8px color-mix(in srgb, var(--accent) 85%, transparent); }
.sec-title .sec-ic, .settings-ic { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }

/* Panel powitalny: jasny w jasnym motywie, ciemny w ciemnym; ramka i poświata akcentu. */
.hero { background: radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 55%), var(--hero-bg);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--accent) 70%, transparent); }
.hero .hero-label { color: var(--accent-ink); letter-spacing: .14em; }
.hero-pass, .hero-goal { background: color-mix(in srgb, var(--hero-text) 4%, transparent); border-color: color-mix(in srgb, var(--hero-text) 10%, transparent); color: var(--hero-text); }
.ring { width: 96px; height: 96px; }
.ring-track { stroke: color-mix(in srgb, var(--hero-text) 12%, transparent); }
.ring-done { stroke: var(--accent); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 80%, transparent)); }
.ring-num { font-family: var(--font-display); font-size: 18px; }

/* Pasek postępu (cele, odznaki, karnet): jeden pasek z „kulką” na końcu. */
.goal-bar { overflow: visible; height: 10px; border: 0; background: color-mix(in srgb, var(--text) 9%, transparent); }
.goal-bar > span { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 50%, transparent), var(--accent));
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 55%, transparent); }
.goal-bar > span::after { content: ''; position: absolute; right: -6px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 0 0 3px var(--accent), 0 0 12px 2px color-mix(in srgb, var(--accent) 70%, transparent); }
.goal-bar > span[style*="width:0%"]::after { display: none; }
.hero-goal .goal-bar { background: color-mix(in srgb, var(--hero-text) 12%, transparent); }
.xp-bar > span { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 50%, transparent), var(--accent)); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent); }
.xp { background: var(--accent); color: var(--on-accent); }

/* Zdobyte odznaki: poświata akcentu. */
.medal.earned { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 55%, transparent)); }

/* Kalendarz: dzisiejszy dzień i linia „teraz” z poświatą. */
.cal-cell.today { box-shadow: 0 0 0 1px var(--accent), 0 8px 22px -10px color-mix(in srgb, var(--accent) 80%, transparent); }
.cal-cell.today .cal-day, .tg-day.is-today b { box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 70%, transparent); }
.tg-now, .tg-now::before { box-shadow: 0 0 10px 1px color-mix(in srgb, var(--bad) 70%, transparent); }

/* Ekran logowania: zawsze ciemny panel z logo; kafelki z możliwościami. */
.login-hero { --hero-bg: #0c0a0e; --hero-text: #f3eee9; --hero-muted: #a89f97; align-items: flex-start;
  background: radial-gradient(circle at 30% 10%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 45%),
    radial-gradient(rgb(255 255 255 / .07) 1px, transparent 1px), #0c0a0e; background-size: 100% 100%, 22px 22px; }
.login-hero .login-logo { height: 92px; margin-bottom: 18px; filter: drop-shadow(0 0 22px color-mix(in srgb, var(--accent) 50%, transparent)); }
.login-hero .login-logo .logo-on-light { display: none; }
.login-hero .login-logo .logo-on-dark { display: block; }
.login-hero h1 { font-family: var(--font); font-weight: 700; letter-spacing: -.02em; margin-bottom: 26px; }
.login-hero .brand-accent { color: var(--accent-hero); }
.login-points { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: min(460px, 100%); }
.login-points li { padding: 12px; border-radius: 14px; border: 1px solid rgb(255 255 255 / .09); background: rgb(255 255 255 / .03); font-size: .85rem; line-height: 1.3; }
.login-points .icon { background: none; padding: 0; width: 22px; height: 22px; }
.login.card { border-radius: 22px; }
@media (max-width: 820px) {
  .login-hero { align-items: center; text-align: center; padding: 48px 20px 76px; }
  .login-hero .login-logo { height: 80px; margin-bottom: 14px; }
  .login-hero h1 { margin-bottom: 0; }
}
.consent-card .consent-logo { height: 56px; }

/* Filmy: zawsze ciemne tło odtwarzacza. */
.video-frame, .video-play { --hero-bg: #0c0a0e; --hero-text: #f3eee9; }

/* Telefon: pływające dolne menu z poświatą przy aktywnej zakładce. */
@media (max-width: 720px) {
  main { padding-bottom: calc(108px + env(safe-area-inset-bottom)); }
  .mainnav, .tabs.primary-tabs { left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); padding: 6px;
    border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 14px 34px -12px rgb(0 0 0 / .45); }
  .mainnav a[aria-current="page"] .icon, .tabs.primary-tabs .tab[aria-selected="true"] .icon { box-shadow: 0 0 14px -2px color-mix(in srgb, var(--accent) 70%, transparent); }
  .topbar .brand .brand-logo { height: 30px; }
}

/* Ekran startowy zawodnika: kafelki (do uzupełnienia, karnet, najbliższy trening, cel, odznaki). */
.start { display: grid; gap: 14px; margin-bottom: 22px; }
.st-hello { display: grid; gap: 2px; }
.st-hello h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.1rem); }
.st-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 14px; align-items: stretch; } /* 2 + 2 on a computer, 1 column on a phone */
.st-tile { margin: 0; display: flex; flex-direction: column; gap: 10px; border-radius: 20px; min-width: 0; }
.st-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.st-label { display: inline-flex; align-items: center; gap: 6px; font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.st-label .icon { width: 16px; height: 16px; color: var(--accent-ink); }
.st-big { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
.st-pct { font-family: var(--font-display); font-weight: 700; color: var(--accent-ink); }
.st-more { padding: 0; font-size: .85rem; font-weight: 700; align-self: flex-start; }
.st-head .st-more { align-self: auto; }

.st-pass { flex-direction: row; align-items: center; gap: 18px;
  background: radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), var(--surface);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent); box-shadow: 0 18px 40px -24px color-mix(in srgb, var(--accent) 80%, transparent); }
.st-pass .ring { width: 108px; height: 108px; }
.st-pass .ring circle { stroke-width: 9; }
.st-pass .ring-track { stroke: color-mix(in srgb, var(--text) 10%, transparent); }
.st-pass .ring-num { fill: var(--text); font-size: 22px; }
.ring-cap { fill: var(--muted); font: 600 10px var(--font); }
.st-pass-info { display: grid; gap: 3px; min-width: 0; }
.st-pass-info .st-label { color: var(--accent-ink); }

.st-next-row { display: flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none; border-radius: 14px; padding: 4px; margin: -4px; }
.st-next-row:hover { background: var(--surface-2); }
.st-next-row > .icon { color: var(--muted); }
.st-next-row .grow, .st-rate li .grow { display: grid; gap: 2px; min-width: 0; }
.st-next-row .date-tile { border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); color: var(--accent-ink); }

.st-level { display: flex; align-items: center; gap: 12px; width: 100%; padding: 4px; margin: -4px; border: 0; border-radius: 14px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.st-level:hover { background: var(--surface-2); }
.st-level .grow { display: grid; gap: 2px; }
.st-level .grow strong { font-family: var(--font-display); font-size: 1.05rem; }
.st-level > .icon { color: var(--muted); }
.st-level .lvl { width: 46px; height: 46px; flex: none; }
.goal-bar.xp-line { height: 6px; }
.goal-bar.xp-line > span::after { display: none; }
.st-medals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.st-medal { display: grid; justify-items: center; gap: 4px; padding: 6px 2px; border: 0; border-radius: 12px; background: none; color: var(--text); font: inherit; font-size: .7rem; line-height: 1.25; text-align: center; cursor: pointer; }
.st-medal:hover { background: var(--surface-2); }
.st-medal .medal { width: 44px; height: 44px; }

.st-rate { border-color: var(--accent); background: linear-gradient(150deg, var(--accent-soft), var(--surface) 70%);
  box-shadow: 0 0 0 1px var(--accent), 0 14px 34px -20px color-mix(in srgb, var(--accent) 90%, transparent); }
.st-rate .st-label, .st-rate .st-label .icon { color: var(--accent-ink); }
.st-rate p { margin: 0; }
.st-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.st-list li { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line); }
.st-list .date-tile { flex: none; }
.btn.small { padding: 7px 14px; font-size: .82rem; }

.ex-dialog .ach-streak { margin: 14px 0 6px; }
.ex-dialog .ach-next h3 { margin: 14px 0 8px; }
.ex-dialog .goals > .sec-title { display: none; } /* the window has its own title */
.push-blocked ol { margin: 6px 0 10px; padding-left: 20px; display: grid; gap: 4px; }
/* Owner's client list: training reminders on / off */
.push-state { display: inline-flex; align-items: center; gap: 4px; white-space: normal; overflow: visible; text-overflow: clip; }
.push-state .icon { width: 13px; height: 13px; }
.push-state.on { color: var(--good); }
.push-state.off { color: var(--muted); }
.push-summary { display: flex; align-items: center; gap: 6px; margin: -6px 0 12px; }
.push-summary .icon { width: 16px; height: 16px; color: var(--accent-ink); }

/* ---------- plan sheet: exercise → weeks 1..N below it (the trainer's spreadsheet layout) ---------- */
.view-switch { margin-bottom: 6px; }
.plan-sheet { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: .88rem; }
.plan-sheet th, .plan-sheet td { padding: 5px 6px; white-space: nowrap; border-bottom: 1px solid var(--line, rgba(127,127,127,.18)); }
.plan-sheet thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.plan-sheet th.sh-load, .plan-sheet td.sh-load { text-align: center; min-width: 3.2em; }
.plan-sheet td.num { text-align: right; font-variant-numeric: tabular-nums; }
.plan-sheet .sheet-ex-head th { text-align: left; padding-top: 14px; font-size: .95rem; background: color-mix(in srgb, var(--accent) 10%, transparent); border-left: 3px solid var(--accent); }
.plan-sheet .sheet-ex-head .code-pill { margin-right: 4px; }
.plan-sheet td.sh-week { font-weight: 600; color: var(--muted); position: sticky; left: 0; background: var(--surface); z-index: 1; }
.plan-sheet tr.is-inherited td { color: color-mix(in srgb, var(--text, currentColor) 45%, transparent); }
.plan-sheet tr.is-inherited td.sh-week { color: var(--muted); }
.plan-sheet .sh-rep { margin-left: 6px; font-size: .7rem; font-weight: 500; padding: 1px 5px; border-radius: 6px; border: 1px dashed var(--muted); }
.plan-sheet .sh-done { margin-left: 6px; color: var(--good, #22a06b); display: inline-flex; vertical-align: middle; }
.plan-sheet .sh-done .icon { width: 14px; height: 14px; }
.plan-sheet td.sh-vol { font-weight: 700; }
.plan-sheet td.is-empty { color: var(--muted); opacity: .6; }
.plan-sheet.editing input.sh-in { padding: 5px 6px; min-width: 0; width: 7em; }
.plan-sheet.editing input.sh-s { width: 4.2em; text-align: center; }
.plan-sheet.editing input.sh-notes { width: 12em; }
.plan-sheet.editing input.inherit { opacity: .5; border-style: dashed; }
.plan-sheet .we-cardio { display: flex; gap: 6px; }
.sheet-sum-table th, .sheet-sum-table td { white-space: nowrap; }
.sheet-sum-table tbody th { text-align: left; font-weight: 600; }
.sheet-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 12px 0 6px; }
.sheet-chart { border: 1px solid var(--line, rgba(127,127,127,.18)); border-radius: 12px; padding: 8px 10px; }
.sheet-chart-title { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; text-align: center; margin-bottom: 4px; }
.sheet-chart .an-legend { display: none; }
.ps-vol { fill: #3b82f6; } .ps-int { fill: #ef4444; } .ps-rpe { fill: #22c55e; }

/* ---------- calendar colours: colour = status (variant B) – orange stays for "today" and buttons ---------- */
:root { --st-plan-line: #bfb5ab; --st-done-bg: #dcf3e4; --st-done-ink: #14532d; --st-done-line: #a7dcb9;
  --st-bad-bg: #fdeceb; --st-bad-ink: #991b1b; --st-bad-line: #f19a93; --st-solo-bg: #f1eafd; --st-solo-ink: #5b21b6; --st-solo-line: #b99af3;
  --st-cons-bg: #e3f2fb; --st-cons-ink: #075985; --st-cons-line: #5fb3e0; --st-cons-solid: #0369a1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --st-plan-line: #5a5058; --st-done-bg: #15301f; --st-done-ink: #86efac; --st-done-line: #2b5a3c;
  --st-bad-bg: #3b1a1a; --st-bad-ink: #fca5a5; --st-bad-line: #7f2d2d; --st-solo-bg: #261c3a; --st-solo-ink: #c4b5fd; --st-solo-line: #5b4692;
  --st-cons-bg: #0e2a3a; --st-cons-ink: #7dd3fc; --st-cons-line: #1f6a92; --st-cons-solid: #0369a1; } }
:root[data-theme="dark"] { --st-plan-line: #5a5058; --st-done-bg: #15301f; --st-done-ink: #86efac; --st-done-line: #2b5a3c;
  --st-bad-bg: #3b1a1a; --st-bad-ink: #fca5a5; --st-bad-line: #7f2d2d; --st-solo-bg: #261c3a; --st-solo-ink: #c4b5fd; --st-solo-line: #5b4692;
  --st-cons-bg: #0e2a3a; --st-cons-ink: #7dd3fc; --st-cons-line: #1f6a92; --st-cons-solid: #0369a1; }
.chip.status-planned, .tg-ev.status-planned { background: var(--surface); color: var(--text); border: 1px solid var(--st-plan-line); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.chip.status-done, .tg-ev.status-done { background: var(--st-done-bg); color: var(--st-done-ink); border: 1px solid var(--st-done-line); box-shadow: none; }
.chip.status-cancelled, .tg-ev.status-cancelled { background: transparent; color: var(--muted); border: 1px dashed var(--st-plan-line); box-shadow: none; text-decoration: line-through; }
.chip.no-pass, .tg-ev.no-pass { background: var(--st-bad-bg); color: var(--st-bad-ink); border: 1px solid var(--st-bad-line); box-shadow: none; }
.chip.solo, .tg-ev.solo { background: var(--st-solo-bg); color: var(--st-solo-ink); border: 1px dashed var(--st-solo-line); box-shadow: none; }
/* Consultation: blue – planned light, done filled */
.chip.consult, .tg-ev.consult { background: var(--st-cons-bg); color: var(--st-cons-ink); border: 1px solid var(--st-cons-line); box-shadow: inset 3px 0 0 var(--st-cons-solid); }
.chip.consult.status-done, .tg-ev.consult.status-done { background: var(--st-cons-solid); color: #fff; border-color: var(--st-cons-solid); box-shadow: none; }
.seq-pill.consult { background: var(--st-cons-bg); color: var(--st-cons-ink); border-color: var(--st-cons-line); }
.btn.consult-btn { background: var(--st-cons-bg); color: var(--st-cons-ink); border-color: var(--st-cons-line); }
.status-done:not(.solo) .log-mark .lm { background: var(--accent); color: var(--on-accent); }
.tr-tag { display: inline-block; font-size: .62rem; font-weight: 700; letter-spacing: .02em; line-height: 1.4; padding: 0 4px; border-radius: 4px; background: color-mix(in srgb, currentColor 12%, transparent); text-decoration: none; flex: none; }
.tg-ev-meta .tr-tag { margin-left: 5px; }
.cal-legend .legend-log .tr-tag { margin-right: 4px; color: var(--text); }

/* ---------- calendar filters: which trainings (staff) and the weekend on / off ---------- */
.cal-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: -4px 0 12px; }
.cal-filters .seg button { padding: 6px 12px; font-size: .8rem; }
.cal-grid.no-weekend { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.switch-row { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; }
.switch-row input[role="switch"] { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; margin: 0; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; flex: none; border: 0; padding: 0; min-width: 0; }
.switch-row input[role="switch"]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .15s; }
.switch-row input[role="switch"]:checked { background: var(--accent); }
.switch-row input[role="switch"]:checked::after { transform: translateX(16px); }
.switch-row input[role="switch"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 720px) { .cal-filters .seg { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: 14px; } .cal-filters .seg button { padding: 6px 6px; border-radius: 10px; line-height: 1.2; white-space: normal; } }
