/* =========================
   /me – premium header (hero)
   ========================= */
.me-hero{
  position: relative;
  overflow: hidden;
  padding: 14px 16px;
}
@media (min-width: 768px){
  .me-hero{ padding: 18px 20px; }
}
.me-hero::before{
  content: "";
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(800px 260px at 0% 0%, rgba(255,106,31,0.26), transparent 62%),
    radial-gradient(700px 240px at 100% 0%, rgba(255,255,255,0.10), transparent 60%);
  pointer-events: none;
}
html[data-theme="light"] .me-hero::before{
  background:
    radial-gradient(800px 260px at 0% 0%, rgba(255,106,31,0.18), transparent 62%),
    radial-gradient(700px 240px at 100% 0%, rgba(11,11,13,0.06), transparent 60%);
}
.me-hero > *{ position: relative; z-index: 1; }
.me-hero-title{ font-weight:700; letter-spacing: 0.2px; }
.me-hero-logo-wrap{
  /* Premium brand badge (trainer logo) */
  --logo-size: 88px;
  width: var(--logo-size);
  height: var(--logo-size);
  aspect-ratio: 1 / 1;      /* safety: never stretch into a "pill" on mobile */
  flex: 0 0 auto;           /* prevent flex stretching */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,106,31,0.92), rgba(255,255,255,0.16));
  box-shadow: 0 16px 34px rgba(0,0,0,0.18);
  transition: transform 140ms ease, box-shadow 140ms ease;
  overflow: hidden;
}
.me-hero-logo-wrap:hover{
  transform: translateY(-1px);
  box-shadow: 0 20px 44px rgba(0,0,0,0.22);
}

.me-hero-logo{
  width: 100%;
  height: 100%;
  display: block;           /* avoid iOS inline-image baseline quirks */
  object-fit: contain;      /* keep trainer logo readable */
  border-radius: 20px;
  background: rgba(255,255,255,.06);
  padding: 8px;            /* less padding so logo isn't tiny */
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
}

html[data-theme="light"] .me-hero-logo-wrap{
  background: linear-gradient(135deg, rgba(255,106,31,0.86), rgba(11,11,13,0.08));
  box-shadow: 0 14px 30px rgba(11,11,13,0.14);
}
html[data-theme="light"] .me-hero-logo{
  background: rgba(11,11,13,.04);
  border: 1px solid rgba(11,11,13,.12);
}

/* Mobile: cleaner, less "heavy", always square */
@media (max-width: 576px){
  .me-hero-logo-wrap{
    --logo-size: 86px;
    border-radius: 18px;
    box-shadow: 0 10px 22px rgba(0,0,0,0.14);
  }
  .me-hero-logo{
    border-radius: 16px;
    padding: 8px;
  }
}

@media (min-width: 768px){
  .me-hero-logo-wrap{ --logo-size: 112px; border-radius: 26px; }
  .me-hero-logo{ border-radius: 24px; padding: 10px; }
}



/* ===== /me (panel klienta) layout – premium & czytelny (desktop + mobile) ===== */
.me-dashboard-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* ===== /me (panel klienta) – podsumowanie + KPI ===== */
.me-atglance{
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  isolation: isolate;
}
.me-atglance::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: inherit;
  background:
    radial-gradient(900px 260px at 0% 0%, rgba(255,106,31,0.18), transparent 60%),
    radial-gradient(700px 240px at 100% 0%, rgba(255,255,255,0.07), transparent 60%);
  pointer-events:none;
  filter: blur(0.2px);
  z-index: 0;
}
.me-atglance > *{
  position: relative;
  z-index: 1;
}

.me-kpi-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 576px){
  .me-kpi-grid{ grid-template-columns: 1fr 1fr; }
}
@media (min-width: 992px){
  .me-kpi-grid{ grid-template-columns: repeat(4, 1fr); }
}

.me-kpi-tile{
  position: relative;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
html[data-theme="light"] .me-kpi-tile{
  background: rgba(11,11,13,0.03);
}

.me-kpi-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 6px;
}

.me-kpi-label{
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.me-kpi-chip{
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  white-space: nowrap;
}

.me-kpi-value{
  font-size: 1.55rem;
  font-weight:700;
  line-height: 1.1;
}

.me-kpi-sub{
  font-size: 12px;
  margin-top: 6px;
}

.me-delta{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  vertical-align: middle;
}
.me-delta.is-up{
  border-color: rgba(34,197,94,0.45);
  background: rgba(34,197,94,0.10);
}
.me-delta.is-down{
  border-color: rgba(239,68,68,0.45);
  background: rgba(239,68,68,0.10);
}

.me-quickactions{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.me-quickactions .btn{
  border-radius: 14px;
}

.me-activity{
  display:flex;
  gap: 6px;
  margin-top: 10px;
}
.me-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  opacity: 0.55;
}
.me-dot.is-on{
  opacity: 1;
  border-color: rgba(255,106,31,0.55);
  background: rgba(255,106,31,0.25);
}





/* Light theme: make /me weekly activity dots more readable (premium contrast) */
html[data-theme="light"] .me-dot{
  background: rgba(11,11,13,0.12);
  border-color: rgba(11,11,13,0.22);
  opacity: 0.75;
}
html[data-theme="light"] .me-dot.is-on{
  border-color: rgba(255,106,31,0.85);
  background: rgba(255,106,31,0.45);
  box-shadow: 0 0 0 2px rgba(255,106,31,0.18);
}
.me-inner-panel{
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}

html[data-theme="light"] .me-inner-panel{
  background: rgba(11,11,13,0.03);
}

/* ===== /me (panel klienta) – premium calendar ===== */
.me-cal-header{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Trainer calendar – toolbar layout (month controls LEFT, actions RIGHT) */
.tr-cal-toolbar{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tr-cal-toolbar-left{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}

.tr-cal-toolbar-right{
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
  justify-content: flex-end;
}

/* Override /me behaviour (it pushes nav to the right). In trainer calendar we keep it on the left. */
.tr-cal-nav{
  margin-left: 0 !important;
  justify-content: flex-start !important;
}

/* allow title block to take space so controls can sit flush right */
.me-cal-header .min-w-0{ flex: 1 1 auto; }

.me-cal-nav{
  display:flex;
  align-items:center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
  justify-content: flex-end;
}

.me-cal-nav-stack{
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: min(100%, 360px);
}

.me-cal-nav-row{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.me-cal-book-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: .62rem .95rem;
  font-weight:700;
  letter-spacing: .01em;
  box-shadow: 0 12px 28px rgba(230, 90, 26, 0.18);
}

.me-cal-book-btn__icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  font-weight:700;
  line-height: 1;
}

html[data-theme="light"] .me-cal-book-btn{
  box-shadow: 0 12px 24px rgba(230, 90, 26, 0.12);
}

@media (min-width: 992px){
  .me-cal-nav{ flex-wrap: nowrap; }
  .me-cal-nav-stack{ min-width: 340px; }
  .me-cal-nav-row{ flex-wrap: nowrap; }
}

@media (max-width: 767.98px){
  .me-cal-nav-stack{ min-width: 100%; }
  .me-cal-nav-row{ justify-content:flex-start; }
  .me-cal-book-btn{ width: 100%; }
}

.me-cal-month{
  font-weight:700;
  letter-spacing: 0.2px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  white-space: nowrap;
}
html[data-theme="light"] .me-cal-month{
  background: rgba(11,11,13,0.03);
}

.me-cal-wrap{
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 992px){
  .me-cal-wrap{ grid-template-columns: 1fr 0.55fr; }
}

.me-cal{
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
}
html[data-theme="light"] .me-cal{
  background: rgba(11,11,13,0.02);
}

.me-cal-weekdays{
  display:grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.me-cal-weekdays > div{ min-width:0; overflow:hidden; text-overflow: ellipsis; }
html[data-theme="light"] .me-cal-weekdays{
  background: rgba(11,11,13,0.02);
}

.me-cal-grid{
  display:grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  padding: 10px;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

.me-cal-cell{
  position: relative;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 16px;
  padding: 10px 8px;
  min-height: 60px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  min-width: 0;

  /* New layout: keep number + markers aligned (no confusing corner numbers) */
  display:flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
}

.me-cal-topline{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-width: 0;
  flex-wrap: nowrap;
}
.me-cal-cell.is-empty{
  border-color: transparent;
  background: transparent;
  cursor: default;
  min-height: 56px;
}

.me-cal-cell:hover{
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.06);
}
html[data-theme="light"] .me-cal-cell:hover{
  background: rgba(11,11,13,0.04);
  border-color: rgba(11,11,13,0.08);
}

/* Make training days obvious (not only tiny dots) */
.me-cal-cell.has-sessions{
  background: rgba(255,106,31,0.06);
  border-color: rgba(255,106,31,0.18);
}
html[data-theme="light"] .me-cal-cell.has-sessions{
  background: rgba(255,106,31,0.07);
  border-color: rgba(11,11,13,0.10);
}

/* If a day has an active (LIVE) session, tint it in a distinct iOS-like blue */
.me-cal-cell.has-active:not(.has-finished){
  background: rgba(96,165,250,0.06);
  border-color: rgba(96,165,250,0.18);
}
html[data-theme="light"] .me-cal-cell.has-active:not(.has-finished){
  background: rgba(96,165,250,0.07);
  border-color: rgba(11,11,13,0.10);
}

/* If both finished + active exist, use a subtle mixed tint */
.me-cal-cell.has-active.has-finished{
  background: linear-gradient(135deg, rgba(255,106,31,0.07), rgba(96,165,250,0.05));
  border-color: rgba(255,255,255,0.08);
}
html[data-theme="light"] .me-cal-cell.has-active.has-finished{
  background: linear-gradient(135deg, rgba(255,106,31,0.08), rgba(96,165,250,0.06));
  border-color: rgba(11,11,13,0.10);
}

.me-cal-daynum{
  flex: 0 0 auto;
  font-weight:700;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  font-variant-numeric: tabular-nums;
}

.me-cal-badge{
  /* Not in the corner anymore -> easier to spot training days */
  position: static;
  font-size: 11px;
  font-weight:700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}
html[data-theme="light"] .me-cal-badge{
  background: rgba(11,11,13,0.04);
}

/* Native-like month view: compact "event chips" inside a day cell (similar to iOS/Android) */
.me-cal-chips{
  display:flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.me-cal-chip{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap: 6px;
  font-size: 10px;
  font-weight:700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  line-height: 1.1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html[data-theme="light"] .me-cal-chip{
  background: rgba(11,11,13,0.04);
}
.me-cal-chip.is-finished{ border-color: rgba(255,106,31,0.55); background: rgba(255,106,31,0.14); color: rgba(255,106,31,0.95); }
.me-cal-chip.is-active{ border-color: rgba(96,165,250,0.70); background: rgba(96,165,250,0.12); color: rgba(96,165,250,0.98); }
.me-cal-chip.is-requested{ border-color: rgba(251,191,36,0.70); background: rgba(251,191,36,0.12); color: rgba(251,191,36,0.98); }
.me-cal-chip.is-scheduled{ border-color: rgba(168, 85, 247, 0.55); background: rgba(168, 85, 247, 0.12); color: rgba(168, 85, 247, 0.98); }
.me-cal-chip.is-confirmed{ border-color: rgba(168, 85, 247, 0.55); background: rgba(168, 85, 247, 0.14); color: rgba(168, 85, 247, 0.98); }
.me-cal-chip.is-cancelled{ border-color: rgba(148,163,184,0.70); background: rgba(148,163,184,0.10); color: rgba(148,163,184,0.98); }
.me-cal-chip.is-availability{ border-color: rgba(45,212,191,0.75); background: rgba(45,212,191,0.12); color: rgba(45,212,191,0.98); }
.me-cal-chip.is-unavailable{ border-color: rgba(239,68,68,0.65); background: rgba(239,68,68,0.12); color: rgba(239,68,68,0.98); }
.me-cal-chip.is-more{ border-style: dashed; opacity: 0.9; }

.me-cal-dots{
  position: static;
  display:flex;
  gap: 6px;
  align-items: center;
}

.me-cal-more{
  font-size: 11px;
  font-weight:700;
  color: var(--muted);
  line-height: 1;
}

.me-cal-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
}
.me-cal-dot.is-finished{
  border-color: rgba(255,106,31,0.60);
  background: rgba(255,106,31,0.32);
}
.me-cal-dot.is-active{
  border-color: rgba(96,165,250,0.70);
  background: rgba(96,165,250,0.18);
}

/* Calendar planning statuses (TrainingEvent) */
.me-cal-dot.is-requested{
  border-color: rgba(251,191,36,0.70);
  background: rgba(251,191,36,0.22);
}
.me-cal-dot.is-scheduled{
  border-color: rgba(168, 85, 247, 0.60);
  background: rgba(168, 85, 247, 0.22);
}
.me-cal-dot.is-confirmed{
  border-color: rgba(168, 85, 247, 0.60);
  background: rgba(168, 85, 247, 0.22);
}
.me-cal-dot.is-cancelled{
  border-color: rgba(148,163,184,0.70);
  background: rgba(148,163,184,0.18);
}
.me-cal-dot.is-declined{
  border-color: rgba(148,163,184,0.70);
  background: rgba(148,163,184,0.18);
}

/* Availability marker (calendar cells) */
.me-cal-dot.is-availability{
  border-color: rgba(45, 212, 191, 0.75);
  background: rgba(45, 212, 191, 0.22);
}
.me-cal-dot.is-unavailable{
  border-color: rgba(239, 68, 68, 0.75);
  background: rgba(239, 68, 68, 0.22);
}
.me-cal-dot.is-availability-ghost{ opacity: 0.35; }

.me-cal-cell.is-today{
  border-color: rgba(255,106,31,0.45);
  background: rgba(255,106,31,0.10);
}
.me-cal-cell.is-today .me-cal-daynum{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255,106,31,0.92);
  color: rgba(255,255,255,0.98);
}
.me-cal-cell.is-selected{
  border-color: rgba(255,106,31,0.70);
  box-shadow: 0 0 0 2px rgba(255,106,31,0.12);
  background: rgba(255,106,31,0.12);
}

/* Show neighbor month days (iPhone-like month grid) */
.me-cal-cell.is-outside{
  opacity: 0.45;
}
.me-cal-cell.is-outside:hover{
  opacity: 0.7;
}

/* Compact status indicator (replaces cluttered dots when badges are visible) */
.me-cal-cell::after{
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 4px;
  border-radius: 999px;
  opacity: 0;
  background: rgba(148,163,184,0.24);
  pointer-events: none;
}
.me-cal-cell.is-status-finished::after{ opacity: 1; background: rgba(255,106,31,0.45); }
.me-cal-cell.is-status-active::after{ opacity: 1; background: rgba(96,165,250,0.42); }
.me-cal-cell.is-status-requested::after{ opacity: 1; background: rgba(251,191,36,0.42); }
.me-cal-cell.is-status-scheduled::after{ opacity: 1; background: rgba(168, 85, 247, 0.42); }
.me-cal-cell.is-status-confirmed::after{ opacity: 1; background: rgba(168, 85, 247, 0.42); }
.me-cal-cell.is-status-cancelled::after{ opacity: 1; background: rgba(148,163,184,0.34); }
.me-cal-cell.is-status-availability::after{ opacity: 1; background: rgba(45,212,191,0.40); }
.me-cal-cell.is-status-unavailable::after{ opacity: 1; background: rgba(239,68,68,0.40); }

/* Desktop month view already shows badges inside cells -> hide underline strips */
@media (min-width: 992px){
  .me-cal-cell::after{ content: none !important; }
}

/* Phones: month cells should not look like stacked "lines".
   We rely on the dot indicators + the selected-day panel instead. */
@media (max-width: 520px){
  .me-cal-cell::after{ content: none !important; }
  .me-cal-chips{ display:none !important; }
  /* Re-enable dots on phones (a broader @media (max-width:576px) rule hides them). */
  .me-cal-dots{ display:flex !important; gap: 5px; }
  .me-cal-dot{ width: 8px; height: 8px; }
  .me-cal-more{ font-size: 10px; font-weight:700; opacity: 0.9; }
}


.me-cal-side{
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255,255,255,0.02);
}
html[data-theme="light"] .me-cal-side{
  background: rgba(11,11,13,0.02);
}

.me-cal-legend{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap: wrap;
}
.me-cal-legend-item{
  display:inline-flex;
  align-items:center;
  gap: 6px;
}

.me-cal-side-list{
  display:flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}
@media (min-width: 992px){
  .me-cal-side-list{ max-height: 520px; }
}

/* Client: request training panel (inline) */
.me-cal-request{
  margin-top: 12px;
  padding: 12px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 122, 26, 0.35);
  background: rgba(255, 122, 26, 0.08);
}
html[data-theme="light"] .me-cal-request{
  background: rgba(255, 122, 26, 0.06);
  border-color: rgba(255, 122, 26, 0.32);
}
.me-cal-slots{
  display:flex;
  flex-wrap: wrap;
  gap: 6px;
}

.me-cal-item{
  display:flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
html[data-theme="light"] .me-cal-item{
  background: rgba(11,11,13,0.03);
}

/* Keep long workout/event names from widening the /me calendar or shifting the page. */
.me-cal-item{
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.me-cal-item-main{
  max-width: 100%;
  overflow: hidden;
}
.me-cal-item-title{
  max-width: 100%;
}

.me-cal-item.me-cal-item-availability{
  border-style: dashed;
  border-color: rgba(45, 212, 191, 0.28);
  background: rgba(45, 212, 191, 0.05);
}
html[data-theme="light"] .me-cal-item.me-cal-item-availability{
  border-color: rgba(45, 212, 191, 0.24);
  background: rgba(45, 212, 191, 0.04);
}

.me-cal-item-title{
  font-weight:700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me-cal-item-meta{
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

/* Make the main block grow so action buttons sit flush to the right edge */
.me-cal-item-main{
  flex: 1 1 auto;
  min-width: 0;
}
.me-cal-item-actions{
  display:flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
.me-cal-action-row{
  display:flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 576px){
  .me-cal-grid{ gap: 5px; padding: 8px; }
  .me-cal-weekdays{ padding: 9px 8px; }
  .me-cal-cell,
  .me-cal-cell.is-empty{ min-height: 48px; padding: 8px 6px; border-radius: 14px; }
  /* Day number and event count must always remain on one line. */
  .me-cal-topline{ justify-content: space-between; gap: 4px; }
  .me-cal-daynum{ font-size: 13px; }
  .me-cal-badge{ font-size: 9px; padding: 2px 4px; }
  /* Phone-like month view: show chips as slim color bars (labels would clutter on small screens) */
  .me-cal-chips{ gap: 3px; }
  .me-cal-chip{ padding: 0; height: 6px; border-radius: 6px; font-size: 0; border-width: 0; }
  .me-cal-chip.is-more{ height: auto; font-size: 10px; padding: 2px 6px; border-width: 1px; }
  .me-cal-dots{ display:none; }
  .me-cal-cell::after{ left: 8px; right: 8px; bottom: 8px; height: 3px; }
  .me-cal-item{ flex-direction: column; align-items: flex-start; width: 100%; }
  .me-cal-item-main{ width: 100%; }
  .me-cal-item-actions{ width: 100%; align-items: stretch; }
  .me-cal-action-row{ justify-content: flex-start; }
  .me-cal-item-actions .btn{ flex: 1 1 auto; }
}

/* Very narrow phones: preserve seven equal columns without wrapping two-digit days. */
@media (max-width: 390px){
  .me-cal-grid{
    gap: 2px;
    padding: 6px 4px;
  }
  .me-cal-weekdays{
    padding: 8px 4px;
    font-size: 10px;
    letter-spacing: 0.15px;
  }
  .me-cal-cell,
  .me-cal-cell.is-empty{
    min-height: 46px;
    padding: 7px 3px;
    border-radius: 12px;
  }
  .me-cal-topline{ gap: 2px; }
  .me-cal-daynum{ font-size: 12px; }
  .me-cal-badge{
    font-size: 8px;
    padding: 2px 3px;
    letter-spacing: -0.02em;
  }
  .me-cal-dots{ gap: 3px !important; }
  .me-cal-dot{ width: 7px; height: 7px; }
}


/* /me – training history list */
.me-history-filters{
  display:flex;
  align-items:center;
  gap: 10px;
}
@media (max-width: 768px){
  .me-history-filters{ width: 100%; }
  .me-history-filters .btn-group{ width: 100%; }
  .me-history-filters .btn{ flex: 1; }
  .me-history-filters select{ width: 100%; }
}

.me-history-scroll{
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.02);
  overflow: auto;
  max-height: 52vh;
  -webkit-overflow-scrolling: touch;
}
html[data-theme="light"] .me-history-scroll{
  background: rgba(11,11,13,0.02);
}
@media (max-width: 768px){
  .me-history-scroll{ max-height: 56vh; }
}

.me-history-scroll .list-group-item{
  background: transparent !important;
  border-color: var(--border) !important;
  color: var(--text-soft);
  padding: 12px 14px;
}
.me-history-scroll .list-group-item:hover{
  background: var(--hover) !important;
}
.me-history-scroll .list-group-item .text-muted{
  color: var(--muted) !important;
}

.me-history-scroll .btn{ white-space: nowrap; }

@media (max-width: 576px){
  .me-history-scroll .list-group-item{
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .me-history-scroll .list-group-item .d-flex.gap-2{
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}
/* ===== /me (panel klienta) – CTA czat z trenerem ===== */

/* ===== Push CTA banner (dashboard + /me) ===== */

.push-cta{
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background:
    radial-gradient(600px 200px at 0% 0%, rgba(255,106,31,0.18), transparent 60%),
    radial-gradient(420px 160px at 100% 0%, rgba(255,255,255,0.08), transparent 55%),
    rgba(255,255,255,0.02);
}
html[data-theme="light"] .push-cta{
  background:
    radial-gradient(600px 200px at 0% 0%, rgba(255,106,31,0.12), transparent 60%),
    radial-gradient(420px 160px at 100% 0%, rgba(11,11,13,0.05), transparent 55%),
    rgba(11,11,13,0.02);
}
.push-cta > *{ position: relative; z-index: 1; }
.push-cta::after{
  content: "";
  position: absolute;
  inset: -2px;
  background: radial-gradient(700px 240px at 35% 0%, rgba(255,106,31,0.10), transparent 60%);
  pointer-events: none;
  opacity: 0.85;
}
html[data-theme="light"] .push-cta::after{
  background: radial-gradient(700px 240px at 35% 0%, rgba(255,106,31,0.08), transparent 60%);
}

.push-cta-inner{
  display:flex;
  align-items:center;
  justify-content: flex-start;
  gap: 16px;
  padding: 14px 16px;
  flex-wrap: wrap;
}

.push-cta-left{
  display:flex;
  align-items:flex-start;
  gap: 12px;
  min-width: 240px;
  flex: 1 1 auto;
}

.push-cta-ico{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(255,106,31,0.16);
  border: 1px solid rgba(255,106,31,0.25);
  flex: 0 0 auto;
  font-size: 18px;
}

.push-cta-title{
  font-weight:700;
  letter-spacing: 0.2px;
}

.push-cta-sub{
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.push-cta-status,
.push-cta-hint{
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.push-cta-actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.push-cta-actions .btn{ border-radius: 999px; }

.push-cta.is-enabled .push-cta-ico{
  background: rgba(34,197,94,0.14);
  border-color: rgba(34,197,94,0.25);
}

.push-cta.is-hidden{ display:none !important; }

@media (max-width: 576px){
  .push-cta-actions{ width: 100%; }
  .push-cta-actions .btn{ width: 100%; }
}

.me-card-chatcta{
  position: relative;
  overflow: hidden;
}
.me-card-chatcta::before{
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(520px 180px at 10% 20%, rgba(255,106,31,0.22), transparent 60%),
    radial-gradient(420px 160px at 90% 0%, rgba(255,255,255,0.10), transparent 55%);
  pointer-events: none;
}
html[data-theme="light"] .me-card-chatcta::before{
  background:
    radial-gradient(520px 180px at 10% 20%, rgba(255,106,31,0.16), transparent 60%),
    radial-gradient(420px 160px at 90% 0%, rgba(11,11,13,0.06), transparent 55%);
}
.me-card-chatcta > *{ position: relative; z-index: 1; }
.me-chatcta-btn{ white-space: nowrap; }

@media (max-width: 576px){
  .me-chatcta-btn{ width: 100%; }
}


/* Desktop: układ 2-kolumnowy + raporty i wykresy na pełną szerokość */
@media (min-width: 992px){
  .me-dashboard-grid{
    grid-template-columns: 1.15fr 0.85fr;
    grid-template-areas:
      "data measures"
      "plan measures"
      "live measures"
      "history history"
      "progress progress"
      "chatcta chatcta";
    align-items: start;
  }
  .me-card-data{ grid-area: data; }
  .me-card-live{ grid-area: live; }
  .me-card-plan{ grid-area: plan; }
  .me-card-history{ grid-area: history; }
  .me-card-measures{ grid-area: measures; }
  .me-card-progress{ grid-area: progress; }
  .me-card-chatcta{ grid-area: chatcta; }

  /* Dłuższa historia treningów i stabilny scroll w karcie */
  #me-history-card .trainings-list-client{ max-height: 620px; }
  #me-history-card .trainings-list-fill{
    flex: 1 1 auto;
    min-height: 0;
  }
}

/* Czytelniejsze tabele obwodów – zawijanie i maks. 2 linie */
.obwody-cell{
  white-space: normal !important;
  max-width: 320px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* ===== Compact left/right body measurements ===== */
.cp-side-pair-grid{
  display:grid;
  gap:10px;
  grid-template-columns:repeat(3, minmax(0, 1fr));
}
.cp-side-pair{
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.03);
  border-radius:16px;
  padding:10px;
}
html[data-theme="light"] .cp-side-pair,
body.light .cp-side-pair{
  border-color:rgba(17,24,39,0.08);
  background:rgba(17,24,39,0.03);
}
.cp-side-pair-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
  font-size:.84rem;
  font-weight:700;
}
.cp-side-pair-head small{
  color:var(--bs-secondary-color, #9ca3af);
  font-size:.72rem;
  font-weight:600;
}
.cp-side-pair-inputs{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.cp-side-mini{
  display:flex;
  align-items:center;
  gap:6px;
  margin:0;
}
.cp-side-mini > span{
  flex:0 0 22px;
  min-width:22px;
  height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  font-size:.78rem;
  font-weight:700;
  color:#ff8b4a;
  background:rgba(255,106,31,0.12);
}
.cp-side-mini .form-control{
  min-width:0;
}
@media (max-width: 991.98px){
  .cp-side-pair-grid{ grid-template-columns:1fr; }
}

/* Delikatnie większe „kafelki” raportów na desktopie */
@media (min-width: 992px){
  .training-open{ padding: 12px 14px; border-radius: 18px; }
  .training-left{ min-width: 72px; }
  .training-meta{ font-size: 0.82rem; }
}

/* ===== /me (panel klienta) mobile tweaks ===== */
@media (max-width: 576px){
  /* On mobile we hide the separate 'Waga' subsection – weight is entered inside body measurements */
  .me-weight-block{ display:none !important; }
}

/* ===== BOOTSTRAP MODALS (stacking + mobile) ===== */
body.modal-open{ overflow:hidden!important; }
/* When a modal is open, let the backdrop cover the sticky navbar too */
body.modal-open .nav-brand{ z-index: 1040 !important; }
/* Ensure correct stacking between modal and backdrop */
.modal{ z-index: 2005; }
.modal-backdrop{ z-index: 2000; }

/* Inputs in light theme */
body.light input{ background:#f6f6f6; color:#111; }




/* --- LIVE mobile UX: prevent iOS double-tap zoom + sticky pressed states --- */
.cp-no-zoom .btn,
.cp-no-zoom button,
.cp-no-zoom .btn-stepper{
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

@media (hover: none) and (pointer: coarse){
  /* iOS Safari potrafi zostawiać "sticky hover" po tapnięciu (wygląda jak wciśnięty przycisk).
     Dla stepperów neutralizujemy :hover/:active/:focus i trzymamy stały wygląd. */
  .btn-stepper:hover,
  .btn-stepper:active,
  .btn-stepper:focus,
  .btn-stepper:focus-visible{
    background: rgba(255,255,255,.06) !important;
    background-color: rgba(255,255,255,.06) !important;
    border-color: rgba(255,255,255,.14) !important;
    color: rgba(255,255,255,.92) !important;
    box-shadow: 0 10px 22px rgba(0,0,0,.20) !important;
    transform: none !important;
    filter: none !important;
    outline: none !important;
  }
  .btn-stepper-plus:hover,
  .btn-stepper-plus:active,
  .btn-stepper-plus:focus,
  .btn-stepper-plus:focus-visible{
    background: linear-gradient(180deg, rgba(255,123,0,.26), rgba(255,123,0,.14)) !important;
    background-color: transparent !important;
    border-color: rgba(255,123,0,.55) !important;
    color: #fff !important;
    box-shadow: 0 10px 22px rgba(0,0,0,.20) !important;
  }
  .btn-stepper-minus:hover,
  .btn-stepper-minus:active,
  .btn-stepper-minus:focus,
  .btn-stepper-minus:focus-visible{
    background: rgba(0,0,0,.18) !important;
    background-color: rgba(0,0,0,.18) !important;
    border-color: rgba(255,255,255,.14) !important;
    color: rgba(255,255,255,.88) !important;
    box-shadow: 0 10px 22px rgba(0,0,0,.20) !important;
  }
}
