/* ============================================================
   STREFA TRENERA — powłoka, motywy i klasy z płótna („Czerwony żar”)
   Kolory motywów wyłącznie przez zmienne --tz-*, aliasy tokenów --ukis-* (spec rozdz. 5.4 projektu wyglądu).
   Czcionki lokalne (libs/fonts, licencja OFL) w styles/zar/fonts.css, bo Strefa działa bez sieci.
   ============================================================ */

/* ---------- Motywy ---------- */
/* Kolory motywów pochodzą z tokenów aplikacji (styles/zar/tokens.css, spec rozdz. 5.4).
   .tz i kafelki .tz-swatch mają własne data-motyw, więc tokeny liczą się dla ich motywu. */
.tz,
.tz-swatch {
    --tz-text: var(--ukis-text);
    --tz-bg: var(--ukis-surface);
    --tz-acc: var(--ukis-color-primary);
    --tz-on-acc: var(--ukis-on-primary);
    --tz-hi: var(--ukis-color-accent);
    --tz-sub: var(--ukis-text-secondary);
    --tz-mut: var(--ukis-text-muted);
    --tz-acc-soft: var(--ukis-primary-soft);
    --tz-ok: var(--ukis-color-success);
    --tz-card-tint: var(--ukis-glass-bg);
    --tz-glow-1: var(--ukis-glow-1);
    --tz-glow-2: var(--ukis-glow-2);
    --tz-glow-3: var(--ukis-glow-3);
    /* Wiersze na karcie (np. lista nagrań): przyciemnienie i linia wspólne dla trzech motywów. */
    --tz-inset-bg: rgba(0, 0, 0, 0.25);
    --tz-inset-line: var(--ukis-separator);
}

/* ---------- Powłoka ---------- */
#trainer-zone.tab-content {
    padding: 0 !important;
    min-height: 0 !important;
}

/* Strefa ma własny pasek (R10). Pływający czat AI aplikacji też znika, bo zasłaniałby ekrany Strefy. */
body.tz-on .bottom-nav-bar,
body.tz-on #edward-chat-toggle,
body.tz-on #edward-chat-window,
body.tz-on #edward-contextual-bubble {
    display: none !important;
}

/* Okrojenie zwykłej części aplikacji (spec rozdz. 10). Wyłączona sekcja tylko się chowa.
   Czat AI powstaje dynamicznie, więc chowa go klasa na <body>.
   W trybie „Tylko Strefa trenera” paska aplikacji nie ma także w Profilu i Serwisie. */
[data-sekcja][hidden],
body.tz-bez-ai #edward-chat-toggle,
body.tz-bez-ai #edward-chat-window,
body.tz-bez-ai #edward-contextual-bubble,
body.tz-tylko .bottom-nav-bar {
    display: none !important;
}

/* Mniej przycisków na pasku → węższa pigułka (64 px na przycisk + 12 px odstępu wewnątrz),
   wyśrodkowana przez left/right i margin: auto z .bottom-nav-bar.z-nav (components.css, ładowany później,
   stąd trzy klasy w selektorze). */
.bottom-nav-bar.z-nav.tz-pasek-wezszy {
    max-width: calc(var(--tz-pasek-n, 5) * 64px + 12px);
    margin: 0 auto;
}

/* Powrót z Profilu i Serwisu do Strefy (tylko w trybie „Tylko Strefa trenera”). */
.tz-return {
    display: none;
    position: fixed;
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 1000;
    min-height: 48px;
    padding: 0 22px 0 16px;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(20, 20, 22, 0.94);
    color: #ffffff;
    font: 600 15px/1 'Inter', system-ui, sans-serif;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    white-space: nowrap;
}

body.tz-tylko:not(.tz-on) .tz-return {
    display: flex;
}

.tz-return .tz-ic {
    width: 20px;
    height: 20px;
}

.tz {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--tz-bg);
    background-image: var(--tz-glow-1), var(--tz-glow-2), var(--tz-glow-3);
    color: var(--tz-text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.45;
    text-shadow: none;
    -webkit-font-smoothing: antialiased;
}

.tz *,
.tz *::before,
.tz *::after {
    box-sizing: border-box;
}

.tz [hidden] {
    display: none !important;
}

.tz .tz-ic {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.tz-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 8px;
    flex-shrink: 0;
}

.tz-logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: contain;
    margin-left: 4px;
}

.tz-title {
    flex: 1;
    min-width: 0;
    font-family: 'Barlow', 'Inter', sans-serif;
    font-style: italic;
    font-weight: 700;
    font-size: 21px;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--tz-text);
}

.tz-icbtn {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: var(--tz-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}

.tz-main {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 16px calc(56px + 32px + env(safe-area-inset-bottom, 0px));
}

.tz-view {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tz-nav {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    max-width: 480px;
    margin: 0 auto;
    height: 56px;
    padding: 6px;
    display: flex;
    gap: 6px;
    border-radius: 999px;
    background: rgba(20, 20, 22, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.tz-navbtn {
    flex: 1;
    min-height: 44px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--tz-sub);
    font: 600 14px/1 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.tz-navbtn.tz-navon {
    background: var(--tz-acc);
    color: var(--tz-on-acc);
    box-shadow: 0 6px 18px var(--tz-acc-soft);
}

.tz button:focus-visible,
.tz input:focus-visible,
.tz select:focus-visible,
.tz textarea:focus-visible {
    outline: 2px solid var(--tz-hi);
    outline-offset: 2px;
}

/* ---------- Klasy z płótna ---------- */
.tz .card {
    background-color: var(--tz-card-tint);
    background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 20px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    padding: 16px;
}

.tz .hd {
    font-family: 'Barlow', 'Inter', sans-serif;
    font-style: italic;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.15;
    letter-spacing: 0.2px;
    color: var(--tz-text);
    margin: 0;
}

.tz p {
    margin: 0;
}

.tz .sub {
    color: var(--tz-sub);
    font-size: 14px;
}

.tz .mut {
    color: var(--tz-mut);
    font-size: 13px;
}

.tz .hi {
    color: var(--tz-hi);
}

.tz .btn,
.tz .ghost {
    min-height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    font: 600 15px/1 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
}

.tz .btn {
    border: none;
    background: var(--tz-acc);
    color: var(--tz-on-acc);
    box-shadow: 0 8px 22px var(--tz-acc-soft);
}

.tz .ghost {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: var(--tz-text);
}

.tz .btn:disabled,
.tz .ghost:disabled {
    opacity: 0.45;
    cursor: default;
    box-shadow: none;
}

.tz .chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: var(--tz-sub);
    font: 500 14px/1 'Inter', sans-serif;
    cursor: pointer;
}

.tz .chip.chipon {
    background: var(--tz-acc);
    border-color: transparent;
    color: var(--tz-on-acc);
}

.tz .tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.tz .tab {
    flex: 1;
    min-height: 44px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--tz-sub);
    font: 600 14px/1 'Inter', sans-serif;
    cursor: pointer;
}

.tz .tab.tabon {
    background: var(--tz-acc);
    color: var(--tz-on-acc);
}

.tz .in {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--tz-text);
    font: 400 16px/1.3 'Inter', sans-serif;
}

/* iOS Safari: pole daty ma własną minimalną szerokość i wystaje poza kartę (zgłoszenie właściciela 2026-11-26). */
.tz input.in[type="date"],
.tz input.in[type="time"] {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    text-align: left;
}

.tz input.in[type="date"]::-webkit-date-and-time-value {
    text-align: left;
}

.tz .in::placeholder {
    color: var(--tz-mut);
}

.tz .in:focus {
    border-color: var(--tz-acc);
}

.tz .tz-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tz .tz-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------- Komunikat i potwierdzenie ---------- */
.tz-toast {
    position: absolute;
    left: 50%;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    max-width: calc(100% - 32px);
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(20, 20, 22, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--tz-text);
    font-weight: 500;
    z-index: 3;
}

.tz-backdrop {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.6);
}

.tz-dialog {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tz-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

/* ---------- Ekrany bez kodu ---------- */
.tz .tz-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tz textarea.in {
    resize: vertical;
}

.tz .tz-error {
    margin: 0;
    color: #FFB4A8;
    font-weight: 600;
}

.tz .tz-error:empty {
    display: none;
}

/* ---------- Hasło i kod awaryjny ---------- */
.tz .tz-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.tz .tz-pw {
    position: relative;
}

.tz .tz-pw .in {
    padding-right: 52px;
}

.tz .tz-pwbtn {
    position: absolute;
    top: 0;
    right: 0;
    width: 48px;
    height: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0 14px 14px 0;
    background: transparent;
    color: var(--tz-sub);
    cursor: pointer;
}

.tz .tz-pwbtn .tz-ic {
    width: 20px;
    height: 20px;
}

.tz .tz-rules {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.tz .tz-rule {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--tz-sub);
    font-size: 14px;
}

.tz .tz-rule-ic {
    display: inline-flex;
    color: var(--tz-mut);
}

.tz .tz-rule-ic .tz-ic {
    width: 18px;
    height: 18px;
}

.tz .tz-rule[data-ok="true"] {
    color: var(--tz-text);
}

.tz .tz-rule[data-ok="true"] .tz-rule-ic {
    color: var(--tz-hi);
}

.tz .tz-check {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    color: var(--tz-text);
    cursor: pointer;
}

.tz .tz-check input {
    flex: none;
    width: 22px;
    height: 22px;
    accent-color: var(--tz-acc);
}

.tz .tz-code {
    font: 700 22px/1.4 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    letter-spacing: 1px;
    color: var(--tz-text);
    text-align: center;
    overflow-wrap: anywhere;
    padding: 14px 10px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.18);
    user-select: all;
    -webkit-user-select: all;
}

.tz .tz-mono {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    letter-spacing: 1px;
}

.tz .tz-warn {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 600;
}

.tz .tz-warn .tz-ic {
    flex: none;
    width: 20px;
    height: 20px;
}

.tz .tz-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.tz .tz-link {
    min-height: 44px;
    padding: 0;
    border: none;
    background: none;
    color: var(--tz-sub);
    font: 500 14px/1.3 'Inter', sans-serif;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-align: left;
    cursor: pointer;
}

/* ---------- Klienci ---------- */
.tz [hidden] {
    display: none !important;
}

.tz .tz-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tz .tz-list {
    display: flex;
    flex-direction: column;
    padding: 6px;
}

.tz .tz-client {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 8px 10px;
    border: none;
    border-radius: 14px;
    background: transparent;
    color: var(--tz-text);
    text-align: left;
    cursor: pointer;
    font: 500 16px/1.2 'Inter', sans-serif;
}

/* Obwódka zamiast jaśniejszego tła: tekst w wierszu ma pod wskaźnikiem ten sam kontrast co bez niego. */
.tz .tz-client:hover {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.tz .tz-client-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.tz .tz-client-name {
    overflow-wrap: anywhere;
}

/* Ciemna pigułka pod plakietką: kontrast ≥ 4,5 : 1 także na jaśniejszym tle wiersza pod wskaźnikiem. */
.tz .tz-badge {
    flex: none;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 13px;
    font-weight: 600;
}

.tz .tz-avatar {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tz-acc);
    color: var(--tz-on-acc);
    font: 700 15px/1 'Inter', sans-serif;
}

.tz .tz-avatar-lg {
    width: 52px;
    height: 52px;
    font-size: 18px;
}

.tz .tz-client-head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.tz .tz-client-title {
    overflow-wrap: anywhere;
}

.tz .tz-note {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.tz .tz-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.tz .tz-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 96px;
    padding: 12px 6px;
    border-radius: 20px;
    background-color: var(--tz-card-tint);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: var(--tz-text);
    font: 600 13px/1.2 'Inter', sans-serif;
    text-align: center;
    cursor: pointer;
}

.tz .tz-menu .ghost {
    justify-content: flex-start;
}

.tz .tz-danger {
    color: #FFB4A8;
}

.tz .tz-pre {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font: 400 14px/1.5 'Inter', sans-serif;
    color: var(--tz-text);
}

/* ---------- Wywiad i ramka zdrowotna ---------- */
.tz .tz-health {
    border: 1px solid var(--tz-hi);
}

.tz .tz-health-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    font: 700 15px/1.2 'Inter', sans-serif;
}

.tz .tz-goalchip {
    margin-top: 4px;
    min-height: 28px;
    padding: 0 10px;
    font-size: 13px;
    cursor: default;
}

.tz .tz-steps {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.tz .tz-stepbtn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 6px 2px;
    background: none;
    border: 0;
    border-bottom: 3px solid rgba(255, 255, 255, 0.22);
    color: var(--tz-sub);
    font: 600 12px/1.2 'Inter', sans-serif;
    cursor: pointer;
}

.tz .tz-stepbtn.tz-stepon {
    border-bottom-color: var(--tz-acc);
    color: var(--tz-text);
}

.tz .tz-stepnum {
    font-size: 15px;
}

.tz .tz-q {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tz .tz-q legend {
    padding: 0;
    margin-bottom: 6px;
}

.tz .tz-yn input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--tz-acc);
}

.tz .tz-yn:has(input:checked) {
    background: var(--tz-acc);
    border-color: transparent;
    color: var(--tz-on-acc);
}

.tz fieldset:disabled .tz-yn {
    opacity: 0.45;
    cursor: default;
}

.tz .tz-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 44px;
}

.tz .tz-check input {
    flex: none;
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: var(--tz-acc);
}

.tz .tz-goals {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.tz .tz-goals .chip {
    justify-content: center;
    text-align: center;
    line-height: 1.2;
}

.tz .tz-cont-goal {
    margin: 0 0 6px;
    color: var(--tz-text);
    font: 600 14px/1.2 'Inter', sans-serif;
}

.tz .tz-cont-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    gap: 8px;
}

.tz .tz-cont-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
}

.tz .tz-cont-cell strong {
    overflow-wrap: anywhere;
}

/* ---------- Ocena funkcjonalna ---------- */
.tz .tz-tile-sub {
    font: 500 11px/1.2 'Inter', sans-serif;
    color: var(--tz-sub);
}

.tz .tz-asm-total {
    margin: 0;
    font-size: 26px;
}

.tz .tz-asm-name {
    margin: 0;
    font-size: 17px;
}

.tz .tz-asm-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    text-align: left;
    color: var(--tz-text);
    cursor: pointer;
}

.tz .tz-side {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tz .tz-sidelabel {
    width: 18px;
    font-weight: 700;
}

.tz .tz-scores {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.tz .tz-sc {
    min-height: 44px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.08);
    color: var(--tz-text);
    font: 700 16px/1 'Inter', sans-serif;
    cursor: pointer;
}

.tz .tz-sc[aria-pressed="true"] {
    border-color: #ffffff;
}

.tz .tz-sc3[aria-pressed="true"] { background: #2e9e57; color: #04140a; }
.tz .tz-sc2[aria-pressed="true"] { background: #f0a030; color: #1a0f00; }
.tz .tz-sc1[aria-pressed="true"] { background: #a84a4a; color: #ffffff; }
.tz .tz-sc0[aria-pressed="true"] { background: var(--tz-acc); color: var(--tz-on-acc); }

.tz .tz-info {
    min-height: 44px;
    min-width: 44px;
    padding: 0;
    justify-content: center;
}

.tz .tz-crit {
    margin: 0;
    padding-left: 18px;
    font-size: 14px;
    color: var(--tz-sub);
}

.tz .tz-how p {
    margin: 0;
    font-size: 14px;
}

.tz .tz-custom .in {
    flex: 1;
    min-width: 0;
}

/* ---------- Pomiary klienta ---------- */
.tz .tz-meas-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
}

.tz .tz-chart {
    display: block;
    width: 100%;
    height: 120px;
}

/* ---------- Ustawienia Strefy ---------- */
.tz .tz-set-hd {
    font-size: 20px;
}

.tz .tz-tight {
    gap: 2px;
}

.tz .tz-themes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.tz .tz-theme {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 96px;
    padding: 10px 6px;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.38);
    color: var(--tz-text);
    font: 600 13px/1.2 'Inter', sans-serif;
    text-align: center;
    cursor: pointer;
}

.tz .tz-theme[aria-pressed="true"] {
    border-color: var(--tz-hi);
}

.tz .tz-swatch {
    display: block;
    width: 100%;
    height: 44px;
    border-radius: 10px;
    background-color: var(--tz-bg);
    background-image: linear-gradient(135deg, transparent 50%, var(--tz-acc) 50%);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* ---------- Wydaj kod (właściciel) ---------- */
.tz .tz-version {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.tz .tz-issued-code {
    word-break: break-all;
    user-select: all;
}

/* ---------- Plany klienta i edytor planu ---------- */
.tz .chip:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.tz .tz-iconline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tz .tz-iconline .tz-ic {
    flex: none;
    width: 18px;
    height: 18px;
}

.tz .tz-ex {
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

/* Superseria z następnym: pasek akcentu łączy ćwiczenie z kolejnym. */
.tz .tz-ex-ss {
    padding-left: 10px;
    border-left: 3px solid var(--tz-acc);
}

.tz .tz-ex-name {
    font-weight: 600;
    overflow-wrap: anywhere;
    min-width: 0;
}

.tz .tz-ex-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

@media (min-width: 520px) {
    .tz .tz-ex-grid:not(.tz-ex-grid2) {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.tz .tz-ex-grid .in {
    padding: 10px 8px;
}

.tz .tz-check .tz-ic {
    flex: none;
    width: 18px;
    height: 18px;
}

/* Okno wyboru ćwiczenia: długa lista przewija się w oknie. */
.tz-picker {
    max-height: 100%;
    overflow-y: auto;
}

.tz .tz-pick-cat {
    justify-content: space-between;
    width: 100%;
}

.tz .tz-pick {
    min-height: 44px;
    padding: 8px 10px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--tz-text);
    font: 500 15px/1.25 'Inter', sans-serif;
    text-align: left;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.tz .tz-pick:hover {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

/* Ćwiczenie z katalogu: nazwa, pod nią wyszarzony wzorzec ruchowy i drobna nazwa angielska. */
.tz .tz-pick.tz-pick-2l {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.tz .tz-pick-sub {
    font-size: 13px;
    font-weight: 400;
}

.tz .tz-pick-en,
.tz .tz-ex-pattern small {
    font-size: 12px;
}

.tz .tz-ex-pattern {
    margin: -4px 0 0;
    font-size: 13px;
}

/* ---------- Przegląd planu ---------- */
.tz .tz-week {
    min-width: 76px;
    justify-content: center;
}

/* Licznik serii roboczych: ciemna pigułka, żeby kontrast był ≥ 4,5 : 1 na każdej karcie. */
.tz .tz-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--tz-sub);
    font: 600 14px/1.2 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
}

/* Ponad limit: kolor wyróżnienia i ikona, bez blokady (spec 9.5). */
.tz .tz-count.tz-over {
    color: var(--tz-hi);
    border-color: var(--tz-hi);
}

.tz .tz-count .tz-ic {
    flex: none;
    width: 16px;
    height: 16px;
}

.tz .tz-plan-actions:empty {
    display: none;
}

.tz .tz-plan-ex + .tz-plan-ex {
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.tz .tz-plan-ex.tz-ex-ss + .tz-plan-ex {
    border-top: none;
}

.tz .tz-warmup summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.tz-dialog fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.tz-dialog legend {
    padding: 0;
    margin-bottom: 6px;
}

/* ---------- Sesja z klientem (spec 9.6) ---------- */
.tz .tz-clockbox {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: right;
}

.tz .tz-clock {
    font: italic 700 32px/1 'Barlow', 'Inter', sans-serif;
    color: var(--tz-text);
    font-variant-numeric: tabular-nums;
}

.tz .tz-sess-ex h3 {
    margin: 0;
    font-size: 16px;
    color: var(--tz-text);
}

/* Ćwiczenia superserii w jednej ramce: pasek akcentu jak w edytorze planu. */
.tz .tz-ss-group {
    border-left: 3px solid var(--tz-acc);
}

.tz .tz-ss-group .tz-sess-ex + .tz-sess-ex {
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.22);
}

.tz .tz-sets {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tz .tz-set,
.tz .tz-sets-hd {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr) 44px;
    gap: 8px;
    align-items: center;
}

.tz .tz-sets-hd {
    padding: 0 4px;
    text-align: center;
}

.tz .tz-set {
    padding: 4px;
    border-radius: 14px;
}

/* Seria wykonana: ciemniejsze tło (kontrast tekstu rośnie) i wypełniony przycisk odhaczenia. */
.tz .tz-set.tz-done {
    background: rgba(0, 0, 0, 0.4);
    box-shadow: inset 0 0 0 1px var(--tz-acc-soft);
}

.tz .tz-setnum {
    text-align: center;
    font: 600 15px/1 'Inter', sans-serif;
    color: var(--tz-sub);
    font-variant-numeric: tabular-nums;
}

.tz .tz-set.tz-done .tz-setnum {
    color: var(--tz-text);
}

.tz .tz-drop .tz-setnum {
    font-size: 13px;
    color: var(--tz-hi);
}

.tz .tz-set .in {
    padding: 10px 6px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.tz .in.tz-invalid {
    border-color: var(--tz-hi);
}

.tz .tz-tick {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: var(--tz-sub);
    cursor: pointer;
}

.tz .tz-tick[aria-pressed="true"] {
    background: var(--tz-acc);
    border-color: transparent;
    color: var(--tz-on-acc);
}

.tz .ghost.tz-small {
    padding: 0 14px;
}

.tz .tz-rpe {
    min-width: 52px;
    justify-content: center;
}

/* ---------- Postępy klienta ---------- */
.tz .tz-stat {
    margin: 0;
    font: 600 18px/1.3 'Inter', sans-serif;
    color: var(--tz-text);
    font-variant-numeric: tabular-nums;
}

/* Wiersz miesiąca: nazwa i liczba, pod nimi pasek na całą szerokość. */
.tz .tz-month {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    column-gap: 12px;
    row-gap: 4px;
    padding: 4px 0;
}

.tz .tz-month-count {
    color: var(--tz-text);
    font-variant-numeric: tabular-nums;
}

.tz .tz-bar {
    grid-column: 1 / -1;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.tz .tz-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--tz-acc);
}

.tz .tz-icbtn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* Eksport planu: przełączniki (role="switch") i zielona ramka „co jest w pliku”. Kolory tekstu tylko ze zmiennych motywu. */
.tz .tz-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 6px 0;
    background: none;
    border: 0;
    color: var(--tz-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.tz .tz-switch:disabled {
    cursor: default;
}

.tz .tz-switch-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tz .tz-switch-knob {
    position: relative;
    flex: none;
    width: 48px;
    height: 28px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.tz .tz-switch-knob::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--tz-text);
    transition: transform 0.15s;
}

.tz .tz-switch[aria-checked="true"] .tz-switch-knob {
    background: var(--tz-acc);
    border-color: transparent;
}

.tz .tz-switch[aria-checked="true"] .tz-switch-knob::after {
    transform: translateX(20px);
    background: var(--tz-on-acc);
}

.tz .tz-switch:disabled .tz-switch-knob {
    opacity: 0.6;
}

.tz .tz-switch:focus-visible {
    outline: 2px solid var(--tz-hi);
    outline-offset: 2px;
}

.tz .card.tz-safe {
    border: 1px solid var(--tz-ok);
}

.tz .tz-safe .tz-ic {
    color: var(--tz-ok);
}

.tz .tz-filename {
    overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
    .tz .tz-switch-knob::after { transition: none; }
}

/* ---------- Wywiad: uwagi i nagrania głosowe ---------- */
.tz .tz-notes-hd {
    font-size: 20px;
}

.tz .tz-notes textarea.in {
    min-height: 96px;
}

.tz .tz-rec {
    align-items: center;
}

.tz .tz-rec-time {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font: 600 16px/1 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    color: var(--tz-text);
}

.tz .tz-rec-time::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--tz-hi);
    animation: tz-rec-pulse 1.2s ease-in-out infinite;
}

@keyframes tz-rec-pulse {
    50% { opacity: 0.35; }
}

.tz .tz-audio {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tz .tz-audio-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 14px;
    background: var(--tz-inset-bg);
    border: 1px solid var(--tz-inset-line);
}

.tz .tz-audio-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tz .tz-audio-time {
    font: 600 15px/1.2 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    color: var(--tz-text);
}

.tz .tz-audio-item .tz-icbtn[aria-pressed="true"] {
    background: var(--tz-acc);
    border-color: transparent;
    color: var(--tz-on-acc);
}

@media (prefers-reduced-motion: reduce) {
    .tz .tz-rec-time::before { animation: none; }
}

/* ---------- Wywiad: wiek i pomiary ---------- */
.tz .tz-body-facts {
    align-items: center;
}

.tz .tz-body-facts p {
    margin: 0;
    flex: 1 1 200px;
}

/* ---------- Zdjęcia sylwetki ---------- */
.tz .tz-photo-pick {
    position: relative;
    overflow: hidden;
}

/* Pole pliku zakrywa cały przycisk (dotyk 44 px), ale jest niewidoczne. */
.tz .tz-file {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.tz .tz-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tz .tz-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.tz .tz-thumb img {
    width: 72px;
    height: 96px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--tz-inset-line);
    background: var(--tz-inset-bg);
}

.tz .tz-compare,
.tz .tz-compare-pick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tz .tz-compare-side {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.tz .tz-compare-img,
.tz .tz-compare-empty {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid var(--tz-inset-line);
    background: var(--tz-inset-bg);
}

.tz .tz-compare-empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Kreator treningu (zakładka „Kreator”): kafle, kartka treningu, stoper. Kolory ze zmiennych motywu. ---------- */
.tz .tz-wk-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tz .tz-wk-tiles.two { grid-template-columns: 1fr 1fr; }
.tz .tz-wk-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 96px; padding: 12px 6px; border-radius: 20px;
    background: var(--tz-card-tint); border: 1px solid rgba(255, 255, 255, 0.22);
    color: var(--tz-text); font: 600 14px/1.2 'Inter', sans-serif; text-align: center; cursor: pointer;
}
.tz .tz-wk-tile small { font: 500 11px/1.25 'Inter', sans-serif; color: var(--tz-sub); }
.tz .tz-wk-tile.on small { color: var(--tz-text); }
.tz .tz-wk-tile.on { border-color: var(--tz-hi); background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 0 0 1px var(--tz-hi); }
.tz .tz-wk-tile .tz-ic { width: 26px; height: 26px; }
.tz .tz-wk-hint {
    font-size: 13px; color: var(--tz-sub); border-left: 3px solid var(--tz-hi);
    padding: 6px 10px; background: rgba(255, 255, 255, 0.05); border-radius: 0 12px 12px 0;
}
.tz .tz-wk-wide { width: 100%; }
.tz .tz-wk-sm { min-height: 44px; padding: 0 14px; font-size: 13px; align-self: flex-start; }
.tz .tz-wk-grow { flex: 1; min-width: 0; }
.tz .tz-wk-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tz .tz-wk-actions { display: flex; flex-wrap: nowrap; gap: 10px; }
.tz .tz-wk-actions > * { flex: 1; min-width: 0; }
.tz .tz-wk-h3 { font-size: 20px; }
.tz .tz-wk-strong { color: var(--tz-text); }
.tz .tz-wk-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; font-size: 14px; }
.tz .tz-wk-field .tz-switch { width: auto; }
.tz .tz-wk-stepper { display: flex; align-items: center; gap: 12px; }
.tz .tz-wk-stepper b { min-width: 74px; text-align: center; font: italic 700 28px/1 'Barlow', 'Inter', sans-serif; font-variant-numeric: tabular-nums; }
.tz .tz-wk-stepper b small { font: 500 12px 'Inter', sans-serif; color: var(--tz-sub); margin-left: 3px; }
.tz .tz-wk-sq {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; padding: 0; flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.2); color: var(--tz-text); cursor: pointer;
}
.tz .tz-wk-sq .tz-ic { width: 18px; height: 18px; }
.tz .tz-wk-sq.tz-wk-round { width: 44px; height: 44px; border-radius: 999px; }
.tz .tz-wk-dots { display: flex; gap: 6px; }
.tz .tz-wk-dots i { flex: 1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); }
.tz .tz-wk-dots i.on { background: var(--tz-hi); }

.tz .tz-wk-exrow { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.tz .tz-wk-exrow:first-of-type { border-top: 0; }
.tz .tz-wk-n { width: 22px; height: 22px; border-radius: 7px; background: var(--tz-acc); color: var(--tz-on-acc); font: 700 12px 'Inter', sans-serif; display: grid; place-items: center; flex: 0 0 auto; }
.tz .tz-wk-nm { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; line-height: 1.25; }
.tz .tz-wk-qty { width: 72px; min-height: 44px; padding: 0 8px; text-align: right; font: italic 700 16px 'Barlow', 'Inter', sans-serif; flex: 0 0 auto; }

.tz .tz-wk-sheet { border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.18); background-color: var(--tz-inset-bg); overflow: hidden; }
.tz .tz-wk-blk { padding: 12px 14px 10px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.tz .tz-wk-blk:first-child { border-top: 0; }
.tz .tz-wk-blk.rest { background: rgba(255, 255, 255, 0.04); }
.tz .tz-wk-bh { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; text-align: left; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.tz .tz-wk-bmain { flex: 1; min-width: 0; }
.tz .tz-wk-bt { font: italic 700 19px/1.15 'Barlow', 'Inter', sans-serif; }
.tz .tz-wk-bm { font-size: 12px; color: var(--tz-hi); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.tz .tz-wk-blk ol { margin: 4px 0 2px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.tz .tz-wk-blk li { display: flex; gap: 10px; font-size: 15px; align-items: baseline; }
.tz .tz-wk-blk li i { font-style: normal; color: var(--tz-hi); font-weight: 700; width: 18px; text-align: right; flex: 0 0 auto; }
.tz .tz-wk-blk li em { font-style: normal; color: var(--tz-sub); margin-left: auto; font-variant-numeric: tabular-nums; }
.tz .tz-wk-badge { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; border-radius: 999px; padding: 3px 10px; background: var(--tz-acc); color: var(--tz-on-acc); }
.tz .tz-wk-badge.o { background: rgba(255, 255, 255, 0.14); color: var(--tz-sub); }
.tz .tz-wk-total { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, 0.12); background: var(--tz-acc-soft); }
.tz .tz-wk-total b { font: italic 700 22px 'Barlow', 'Inter', sans-serif; }

.tz .tz-wk-saved { display: flex; flex-direction: column; gap: 8px; }
.tz .tz-wk-saved-row { display: flex; align-items: center; gap: 8px; }
.tz .tz-wk-saved-open {
    flex: 1; min-width: 0; min-height: 52px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px;
    padding: 6px 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--tz-text); font: inherit; text-align: left; cursor: pointer;
}
.tz .tz-wk-saved-name { font-weight: 600; }

/* Stoper: na ekranie biegu pasek Strefy jest schowany, żeby nie przeszkadzał. */
.tz[data-route="workout-run"] .tz-nav { display: none; }
.tz .tz-wk-run { display: flex; flex-direction: column; gap: 14px; text-align: center; padding-bottom: 24px; }
.tz .tz-wk-phase { align-self: center; padding: 6px 22px; border-radius: 999px; font: 700 14px 'Inter', sans-serif; letter-spacing: 0.12em; text-transform: uppercase; background: var(--tz-acc); color: var(--tz-on-acc); }
.tz .tz-wk-phase.rest { background: var(--tz-ok); color: #04140a; }
.tz .tz-wk-time { font: italic 700 clamp(84px, 30vw, 120px)/1 'Barlow', 'Inter', sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -2px; }
.tz .tz-wk-run-name { font: italic 700 30px/1.15 'Barlow', 'Inter', sans-serif; text-wrap: balance; }
.tz .tz-wk-prog { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.tz .tz-wk-prog i { display: block; height: 100%; background: var(--tz-acc); border-radius: 999px; }
.tz .tz-wk-toggles { text-align: left; gap: 0; display: flex; flex-direction: column; }
.tz .tz-wk-tg { display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-size: 14px; }
.tz .tz-wk-tg .tz-switch { width: auto; }

/* Komunikat z akcją („Cofnij”): na szerokość kart (jak .tz-main i .tz-view), tekst po lewej, przycisk po prawej. */
.tz-toast.tz-toast-action {
    left: 16px;
    right: 16px;
    max-width: 640px;
    margin: 0 auto;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 8px 8px 16px;
    border-radius: 16px;
}

.tz-toast-btn {
    min-height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--tz-hi);
    font: 700 14px/1 'Inter', sans-serif;
    cursor: pointer;
}
