/* --- Chat attachments --- */
.chat-image{
  margin-top:.35rem;
  max-width:100%;
  max-height:320px;
  border-radius:.75rem;
  display:block;
}
.chat-attachment-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

/* --- Chat bubbles --- */
.chat-card{
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  --cp-chat-safe-bottom: min(max(var(--safe-bottom), 0px), 18px);
  --cp-chat-kb-vv: 0px;
  --cp-chat-extra-bottom: calc(max(var(--cp-chat-safe-bottom), var(--cp-kb-native, 0px), var(--cp-chat-kb-vv, 0px)) + 4px);
  --cp-chat-composer-h: 108px;
}
.chat-messages{
  flex: 1 1 auto;
  min-height: 220px;
  max-height: min(62dvh, calc(100dvh - var(--safe-top) - var(--cp-chat-extra-bottom) - 220px));
  overflow-y:auto;
  padding: 1rem 1rem calc(var(--cp-chat-extra-bottom) + .85rem);
  scroll-padding-bottom: calc(var(--cp-chat-composer-h) + var(--cp-chat-extra-bottom) + 18px);
  background: rgba(0,0,0,.10);
}
.chat-row{ display:flex; margin-bottom:.6rem; }
.chat-row.mine{ justify-content:flex-end; }
.chat-row.theirs{ justify-content:flex-start; }

.chat-bubble{
  max-width: min(680px, 92%);
  padding: .65rem .8rem;
  border-radius: 1rem;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
}
.chat-row.mine .chat-bubble{
  background: rgba(255,125,0,.16);
  border-color: rgba(255,125,0,.25);
}

.chat-meta{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:.75rem;
  font-size:.78rem;
  opacity:.88;
  margin-bottom:.25rem;
}
.chat-meta-right{ display:inline-flex; gap:.5rem; align-items:center; }

.chat-text{ white-space:pre-wrap; word-break:break-word; }

/* --- Chat input (pro) --- */
.chat-input{
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: .65rem 1rem calc(.4rem + var(--cp-chat-extra-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface2);
}
.chat-input form{ margin:0; }
.chat-textarea{
  resize: none;
  min-height: 56px;
  max-height: 200px;
  overflow-y: hidden;
  line-height: 1.25;
  padding-top: .55rem !important;
  padding-bottom: .55rem !important;
}
.chat-input .btn{
  height: 42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: .55rem .85rem;
}
@media (max-width: 768px){
  .chat-card{
    max-height: calc(100dvh - var(--safe-top) - 108px);
  }
  .chat-messages{
    max-height: calc(100dvh - var(--safe-top) - var(--cp-chat-extra-bottom) - 235px);
  }
}
@media (max-width: 420px){
  .chat-input{ padding: .52rem .68rem calc(.24rem + var(--cp-chat-extra-bottom)); }
  .chat-input .btn{ padding: .5rem .75rem; }
  .chat-textarea{ min-height: 52px; }
}


.chat-delete{
  border:0;
  background:transparent;
  padding:0;
  line-height:1;
  cursor:pointer;
  opacity:0;
  transition:opacity .15s ease;
  color: rgba(255,255,255,.75);
}
.chat-row:hover .chat-delete{ opacity:1; }

.chat-deleted{
  font-style: italic;
  color: rgba(255,255,255,.65);
}

.chat-image{
  margin-top:.35rem;
  max-width:100%;
  max-height:320px;
  border-radius:.75rem;
  display:block;
}

/* =========================
   Notifications Center
   ========================= */
.notif-page{
  padding-top: 4px;
  padding-bottom: 8px;
}

.notif-subtitle{
  line-height: 1.25;
  max-width: 64ch;
}

.notif-header{
  margin-bottom: 14px;
}

.notif-top-actions .btn{ white-space: nowrap; }

/* Filter chips: horizontal scroll (premium + iPad-friendly) */
.notif-filters{
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 2px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.notif-filters::-webkit-scrollbar{ height: 0; }

.notif-chip{
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  font-weight:700;
  line-height: 1;
  transition: border-color .14s ease, background-color .14s ease, transform .14s ease;
  user-select: none;
  -webkit-user-select: none;
}
html[data-theme="light"] .notif-chip{
  background: rgba(11,11,13,0.04);
}
.notif-chip:active{ transform: translateY(1px); }

.notif-chip.active{
  border-color: rgba(230,90,26,0.65);
  background: rgba(230,90,26,0.10);
}

.notif-chip-count{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight:700;
  border: 1px solid rgba(230,90,26,0.35);
  background: rgba(230,90,26,0.14);
  color: rgba(255,255,255,0.90);
}
html[data-theme="light"] .notif-chip-count{
  color: rgba(11,11,13,0.82);
}

/* List */
.notif-list{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notif-section-title{
  margin-top: 10px;
  margin-bottom: 2px;
  color: var(--muted);
  font-weight:700;
  letter-spacing: .02em;
  text-transform: uppercase;
  font-size: .78rem;
}

.notif-item{
  padding: 14px;
}

.notif-item.is-unread{
  border-color: rgba(230,90,26,0.35);
}

.notif-item-inner{
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: start;
}

.notif-ico{
  width: 40px;
  height: 40px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(230,90,26,0.14);
  border: 1px solid rgba(230,90,26,0.22);
}

.notif-toprow{
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
}

.notif-title{
  font-weight:700;
  letter-spacing: .01em;
}

.notif-badge{
  padding: 4px 9px;
  font-size: .70rem;
  font-weight:700;
}

.notif-body{
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.notif-meta{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .85rem;
  white-space: nowrap;
}

.notif-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(230,90,26,0.12);
}

.notif-actions{
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Mobile / iPad portrait: stack actions under content */
@media (max-width: 680px){
  .notif-item-inner{
    grid-template-columns: 40px 1fr;
  }
  .notif-actions{
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 4px;
  }
}

/* Loading skeleton */
.notif-loading{ display:flex; flex-direction:column; gap:12px; }
.notif-skeleton{
  min-height: 86px;
  position: relative;
  overflow: hidden;
}
.notif-skeleton::before{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.00), rgba(255,255,255,0.06), rgba(255,255,255,0.00));
  transform: translateX(-100%);
  animation: cp_shimmer 1.05s infinite;
}
html[data-theme="light"] .notif-skeleton::before{
  background: linear-gradient(90deg, rgba(11,11,13,0.00), rgba(11,11,13,0.06), rgba(11,11,13,0.00));
}
@keyframes cp_shimmer{
  0%{ transform: translateX(-100%); }
  100%{ transform: translateX(100%); }
}


/* Guide role toggle (Trainer/Client) – clearer active state */
.guide-role-toggle{
  display: inline-flex;
  padding: 5px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  box-shadow: var(--shadow-soft);
}
html[data-theme="light"] .guide-role-toggle{
  background: rgba(11,11,13,0.04);
  box-shadow: var(--shadow-soft);
}
.guide-role-toggle .btn{
  border-radius: 14px !important;
}
.guide-role-toggle .btn-outline-brand{
  box-shadow: none;
  border-color: transparent;
  background: transparent;
  color: var(--text-85);
  padding: 10px 14px;
  line-height: 1;
}
@media (hover: hover) and (pointer: fine){
  .guide-role-toggle .btn-outline-brand:hover{
    background: rgba(230,90,26,0.10);
    transform: translateY(-1px);
  }
}
.guide-role-toggle .btn-outline-brand.active,
.guide-role-toggle .btn-outline-brand[aria-current="page"]{
  background: linear-gradient(135deg, var(--orange), var(--orange2));
  color: #fff;
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: 0 12px 28px rgba(230,90,26,0.20), 0 10px 25px rgba(0,0,0,0.12);
  transform: none;
  position: relative;
}
.guide-role-toggle .btn-outline-brand.active::after,
.guide-role-toggle .btn-outline-brand[aria-current="page"]::after{
  content: "✓";
  font-weight:700;
  margin-left: 8px;
  opacity: 0.95;
}
.guide-role-toggle .btn-outline-brand:focus-visible{
  outline: 3px solid rgba(230,90,26,0.35);
  outline-offset: 2px;
}


/* =========================
   Form micro-UX (info icon + collapsible macros)
   ========================= */

.info-details{ position: relative; }
.info-details > summary{ list-style: none; }
.info-details > summary::-webkit-details-marker{ display:none; }
.info-icon{
  width: 22px; height: 22px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--badge-muted-bg);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight:700;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}
.info-details[open] .info-icon{
  color: var(--text);
  border-color: rgba(230,90,26,0.45);
  background: var(--hover);
}
.info-popover{
  position: absolute;
  right: 0;
  top: 28px;
  width: min(380px, 90vw);
  max-height: 340px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 12px 12px;
  box-shadow: var(--shadow-soft);
  z-index: 60;
}

.macro-details{
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--input-bg);
  padding: 10px 12px;
}
.macro-details > summary{
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}
.macro-details > summary::-webkit-details-marker{ display:none; }
.macro-details .macro-chevron{
  width: 10px; height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .18s ease;
  margin-right: 4px;
  opacity: .9;
}
.macro-details[open] .macro-chevron{ transform: rotate(-135deg); }
.macro-details .macro-body{ margin-top: 10px; }

.macro-pill{
  background: var(--badge-muted-bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight:700;
}
.macro-pill.is-set{
  color: var(--text);
  border-color: rgba(230,90,26,0.45);
  background: var(--hover);
}

/* =========================
   Quick Start / Onboarding
   ========================= */
.cp-quickstart-dialog{
  max-width: 820px;
}

.cp-modal-content{
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01)), #12131a;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
  overflow: hidden;
}

.cp-modal-content .modal-header,
.cp-modal-content .modal-body,
.cp-modal-content .modal-footer{
  background: transparent;
}

.cp-modal-content .modal-header{
  padding-top: max(.65rem, calc(env(safe-area-inset-top, 0px) + .3rem));
  padding-left: .95rem;
  padding-right: .95rem;
  padding-bottom: .25rem;
  align-items: flex-start;
}
.cp-modal-content .modal-title{
  line-height: 1.1;
  margin-bottom: 0;
}
.cp-modal-content .modal-body{
  padding: .45rem .95rem .8rem;
  -webkit-overflow-scrolling: touch;
}
.cp-modal-content .modal-footer{
  padding: .1rem .95rem max(.7rem, calc(env(safe-area-inset-bottom, 0px) + .25rem));
}
.cp-modal-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: .20rem .55rem;
  border-radius: 999px;
  font-weight:700;
  letter-spacing: .06em;
  font-size: .72rem;
  background: rgba(255,122,26,.16);
  border: 1px solid rgba(255,122,26,.35);
  color: var(--brand, #ff7a1a);
}
.cp-step-card{
  display:flex;
  gap: .75rem;
  padding: .78rem .85rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.14);
  min-height: 102px;
}
.cp-step-body{
  min-width: 0;
}
.cp-step-num{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  background: rgba(255,122,26,.18);
  border: 1px solid rgba(255,122,26,.35);
  color: var(--brand, #ff7a1a);
  flex: 0 0 auto;
}
.cp-step-title{ font-weight:700; }
.cp-step-desc{ color: var(--muted); font-size: .92rem; margin-top: .15rem; }
.cp-help-fab{
  position: fixed;
  right: auto;
  left: 18px;
  bottom: calc(18px + var(--fab-extra-bottom, 0px));
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(20,20,25,.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  z-index: 1050; /* above cards, below modal (1055) */
  box-shadow: 0 12px 40px rgba(0,0,0,.55);
  transition: transform .18s ease, bottom .15s ease;
}

/* Light theme: keep the help FAB consistent (avoid "dark blob" look) */
html[data-theme="light"] .cp-help-fab{
  background: rgba(255,255,255,.25);
  border: 1px solid rgba(20,20,25,.14);
  color: rgba(10,10,12,.92);
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}



/* Light theme support for Quick Start modal */
html[data-theme="light"] .cp-modal-content{
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,249,252,.98)), #ffffff;
  color: #141821;
  border: 1px solid rgba(20,24,33,.10);
  box-shadow: 0 24px 70px rgba(16,24,40,.18);
}
html[data-theme="light"] .cp-modal-content .modal-header,
html[data-theme="light"] .cp-modal-content .modal-body,
html[data-theme="light"] .cp-modal-content .modal-footer{
  background: transparent;
}
html[data-theme="light"] .cp-modal-content .modal-title,
html[data-theme="light"] .cp-modal-content .cp-step-title{
  color: #141821;
}
html[data-theme="light"] .cp-modal-content .text-muted,
html[data-theme="light"] .cp-step-desc,
html[data-theme="light"] .cp-modal-content .small.text-muted{
  color: rgba(20,24,33,.72) !important;
}
html[data-theme="light"] .cp-step-card{
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,249,252,.92));
  border: 1px solid rgba(20,24,33,.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}
html[data-theme="light"] .cp-modal-badge{
  background: rgba(255,122,26,.12);
  border-color: rgba(255,122,26,.28);
}
html[data-theme="light"] .cp-step-num{
  background: rgba(255,122,26,.12);
  border-color: rgba(255,122,26,.26);
}
html[data-theme="light"] .cp-modal-content .modal-footer{
  border-top: 1px solid rgba(20,24,33,.08);
}
html[data-theme="light"] #cpQuickStartModal .btn-close,
html[data-theme="light"] #cpQuickStartModal .btn-close:focus{
  filter: none;
  opacity: .72;
}

.cp-help-fab:hover{ transform: translateY(-1px); }
.cp-onboard-strip{
  border-style: dashed;
  border-color: rgba(255,122,26,.30);
  background: linear-gradient(180deg, rgba(255,122,26,.10), rgba(0,0,0,.10));
}
@media (max-width: 575.98px){
  .cp-help-fab{ left: 12px; right: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px + var(--fab-extra-bottom, 0px)); width: 42px; height: 42px; }
  .fab-scroll-top{ right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px + var(--fab-extra-bottom, 0px)); width: 42px; height: 42px; }
  .cp-step-card{ min-height: auto; }
}

/* Tip bar (LIVE training hint) */
.cp-tipbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: .75rem;
  padding: .85rem .95rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.14);
}

/* Compact, premium-friendly variant used in Trening LIVE header */
.cp-tipbar.cp-tipbar-compact{ padding: .55rem .75rem; border-radius: 14px; }

/* Use native <details> so the tip can be collapsed (saves vertical space during LIVE) */
.cp-tipbar-details{ width: 100%; }
.cp-tipbar-summary{
  list-style: none;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: .75rem;
  user-select:none;

  min-width:0;
}
.cp-tipbar-summary::-webkit-details-marker{ display:none; }

.cp-tipbar-title{ font-weight:700; min-width:0; }
.cp-tipbar-meta{
  font-size: .78rem;
  color: var(--muted);
  padding: .15rem .5rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.10);
  white-space: nowrap;
  flex: 0 0 auto;
}

.cp-tipbar-details[open] .cp-tipbar-meta{ color: rgba(255,255,255,.82); border-color: rgba(255,122,26,.35); }

.cp-tipbar-desc{ color: var(--muted); font-size: .90rem; line-height: 1.35; margin-top: .35rem; }

/* Light theme: keep the hint bar subtle (no heavy dark slab) */
html[data-theme="light"] .cp-tipbar{
  background: rgba(0,0,0,.03);
  border-color: rgba(11,11,13,.14);
}

/* Light theme: keep meta pill readable when expanded */
html[data-theme="light"] .cp-tipbar-meta{
  border-color: rgba(0,0,0,.12);
  background: rgba(0,0,0,.03);
  color: rgba(0,0,0,.60);
}
html[data-theme="light"] .cp-tipbar-details[open] .cp-tipbar-meta{
  color: rgba(0,0,0,.72);
  border-color: rgba(255,122,26,.45);
  background: rgba(255,122,26,.10);
}
html[data-theme="light"] .cp-tipbar-meta{
  background: rgba(255,255,255,.65);
  border-color: rgba(0,0,0,.10);
  color: rgba(0,0,0,.55);
}

/* LIVE session header actions */
.session-live-top-actions{
  display:flex;
  flex-wrap:wrap;
  align-items:stretch;
  justify-content:flex-end;
  gap:.65rem;
  width:100%;
}
.session-live-top-actions .btn{
  min-height:46px;
  border-radius:14px;
  font-weight:700;
  justify-content:center;
  white-space:nowrap;
}
.session-live-inline-form,
.session-live-finish-form{
  display:flex;
  margin:0;
  width:100%;
}
.session-live-primary-slot,
.session-live-secondary-actions{
  display:flex;
  flex-wrap:wrap;
  align-items:stretch;
  gap:.65rem;
}
.session-live-secondary-actions{
  justify-content:flex-end;
}
.session-live-primary-action,
.session-live-secondary-btn,
.session-live-danger-btn{
  width:100%;
  padding:.72rem 1rem;
}
.session-live-top-actions--trainer-active .session-live-action-wrap{
  flex:1 1 calc(50% - .325rem);
  min-width:0;
}
.session-live-top-actions--trainer-active .session-live-action-wrap--finish{
  flex-basis:100%;
}
@media (min-width: 992px){
  .session-live-top-actions{
    width:auto;
    max-width:100%;
  }
  .session-live-top-actions--trainer-active{
    flex-wrap:nowrap;
  }
  .session-live-top-actions--trainer-active .session-live-action-wrap{
    flex:0 0 auto;
    min-width:170px;
  }
  .session-live-top-actions--trainer-active .session-live-action-wrap--client{ order:1; }
  .session-live-top-actions--trainer-active .session-live-action-wrap--finish{ order:2; }
  .session-live-top-actions--trainer-active .session-live-action-wrap--delete{ order:3; }
  .session-live-top-actions--trainer-active .session-live-action-wrap--finish .session-live-primary-action{
    min-width:210px;
  }
}
@media (max-width: 767.98px){
  .session-live-top-actions,
  .session-live-primary-slot,
  .session-live-secondary-actions{
    width:100%;
  }
  .session-live-primary-slot > *,
  .session-live-secondary-actions > *,
  .session-live-secondary-actions form,
  .session-live-secondary-actions a,
  .session-live-primary-slot form,
  .session-live-primary-slot a{
    width:100%;
  }
  .session-live-top-actions .btn{
    width:100%;
    min-height:44px;
    white-space:normal;
  }
}

/* LIVE header compact meta form (date + note) */
.session-meta-compact .form-label{ margin-bottom: .25rem; }
.session-meta-compact .session-meta-hint{
  margin-top: .15rem;
  font-size: .78rem;
  line-height: 1.2;
}
.session-note-flex{
  width:100%;
}
.session-note-flex > .flex-grow-1{
  min-width:0;
}
.session-note-save{
  height: 38px;
  padding: .45rem .9rem;
  border-radius: 999px;
  white-space: nowrap;
}
@media (min-width: 768px){
  .session-note-save{
    min-width: 180px;
  }
}

.cp-tipbar-actions{ display:flex; align-items:center; }
.cp-tipbar-actions .btn{ white-space: nowrap; }

@media (max-width: 575.98px){
  .cp-tipbar{ flex-direction:column; align-items:stretch; }
  .cp-tipbar-actions{ justify-content:flex-end; }
  .cp-tipbar-desc{ font-size: .88rem; }
  /* Keep summary in one row: title truncates, button stays visible */
  .cp-tipbar-summary{ flex-wrap:nowrap; }
  .cp-tipbar-title{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .cp-tipbar-meta{ white-space:nowrap; }
}


/* LIVE training: reliable mobile/desktop visibility for volume card.
   Do not rely only on Bootstrap display helpers, because the native WebView/iPad breakpoints
   and hidden-state updates can leave the mobile card invisible after AJAX updates. */
.cp-session-volume-mobile{ display:block; }
.cp-session-volume-desktop{ display:none; }
@media (min-width: 1200px){
  .cp-session-volume-mobile{ display:none !important; }
  .cp-session-volume-desktop{ display:block; }
}
@media (max-width: 1199.98px){
  .cp-session-volume-mobile:not([hidden]){ display:block !important; }
  .cp-session-volume-desktop{ display:none !important; }
}
.cp-session-volume-mobile[hidden]{ display:none !important; }

/* LIVE training: compact "Objętość na partie" on mobile (placed before exercises) */
.cp-volume-compact{ padding: 12px 14px; }
.cp-volume-details{ width: 100%; }

.cp-volume-summary{
  list-style: none;
  cursor: pointer;
  user-select:none;
  display:flex;
  flex-direction:column;
  gap: .55rem;
}
.cp-volume-summary::-webkit-details-marker{ display:none; }

.cp-volume-summary-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: .75rem;
  min-width:0;
}
.cp-volume-title{ font-weight:700; min-width:0; }

.cp-volume-meta{
  font-size: .78rem;
  color: var(--muted);
  padding: .15rem .5rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.10);
  white-space: nowrap;
  flex: 0 0 auto;
}
.cp-volume-details[open] .cp-volume-meta{
  color: rgba(255,255,255,.82);
  border-color: rgba(255,122,26,.35);
  background: rgba(255,122,26,.08);
}

/* Small preview pills shown even when collapsed */
.cp-volume-peek{
  display:flex;
  gap: .35rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: .15rem;
}
.cp-volume-peek::-webkit-scrollbar{ height: 6px; }
.cp-volume-peek::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.12); border-radius: 999px; }
.cp-volume-peek::-webkit-scrollbar-track{ background: transparent; }
.cp-volume-peek-pill{
  font-size: .74rem;
  padding: .18rem .5rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.08);
  color: rgba(255,255,255,.84);
  white-space:nowrap;
  flex: 0 0 auto;
}

.cp-volume-body{
  margin-top: .25rem;
  padding-top: .65rem;
  border-top: 1px solid rgba(255,255,255,.10);
}
.cp-volume-chips{ display:flex; flex-direction:column; gap: .5rem; }
.cp-volume-chip{
  padding: .55rem .65rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.10);
}
.cp-volume-chip-name{ font-weight:700; font-size: .92rem; }
.cp-volume-chip-meta{ margin-top: .1rem; color: var(--muted); font-size: .78rem; line-height: 1.25; }

/* Light theme: keep it subtle and readable */
html[data-theme="light"] .cp-volume-meta{
  background: rgba(255,255,255,.65);
  border-color: rgba(0,0,0,.10);
  color: rgba(0,0,0,.55);
}
html[data-theme="light"] .cp-volume-details[open] .cp-volume-meta{
  color: rgba(0,0,0,.72);
  border-color: rgba(255,122,26,.45);
  background: rgba(255,122,26,.10);
}
html[data-theme="light"] .cp-volume-peek-pill{
  background: rgba(255,255,255,.70);
  border-color: rgba(0,0,0,.10);
  color: rgba(0,0,0,.68);
}
html[data-theme="light"] .cp-volume-chip{
  background: rgba(0,0,0,.03);
  border-color: rgba(11,11,13,.14);
}

/* =========================
   LIVE training: big reorder arrows
   ========================= */
.live-move-col{
  display:flex;
  flex-direction:column;
  gap: .35rem;
  margin-right: .1rem;
}
.live-move-btn{
  width: 46px;
  height: 46px;
  padding: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size: 1.12rem;
  line-height: 1;
  border-radius: 14px;
}
.live-move-btn[disabled]{
  opacity: .35;
  cursor: not-allowed;
}
@media (min-width: 992px){
  .live-move-btn{ width: 42px; height: 42px; border-radius: 12px; }
}

/* === CoachPro UI System: Tabs (internal, no reload) === */
.cp-tabs-scope{ margin-bottom: 1rem; }
.cp-center-wrap{ max-width: 1200px; margin: 0 auto; }
.cp-tabbar{
  display:flex; gap:.5rem; flex-wrap:wrap;
  padding:.65rem; border-radius: 18px;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.07);
  backdrop-filter: blur(10px);
}

/* Hide horizontal scrollbar for tab bars (keep scroll). */
.cp-tabbar{
  scrollbar-width: none;
}
.cp-tabbar::-webkit-scrollbar{
  width: 0;
  height: 0;
  display: none;
}


/* Sticky tabbar: keep tabs visible and above page content (under the sticky navbar).
   Use measured navbar height + safe-top instead of hardcoded values, otherwise tabs can slide
   partially under the header on Android / devices with cutouts after scrolling. */
.cp-tabbar.cp-tabbar-sticky{
  position: sticky;
  top: calc(var(--safe-top, 0px) + var(--nav-h, 0px) + 6px);
  z-index: 1180;
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
}


/* Mobile hint that tabs are horizontally scrollable */
.cp-tabbar-hint{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  margin-top: .35rem;
  margin-bottom: 1rem;
  font-size: .78rem;
  color: rgba(255,255,255,.55);
  user-select:none;
}
.cp-tabbar-hint .chev{ opacity: .85; font-weight:700; }

.cp-client-context{display:flex;align-items:center;flex-wrap:wrap;gap:.4rem;padding:.25rem .25rem;margin-top:-.25rem;}
.cp-client-context .badge{font-weight:600;}

/* Client detail: subtle "back to clients" button on the right */
.cp-back-to-clients{
  padding: .28rem .70rem;
  border-radius: 999px;
  box-shadow: none !important;
  background: rgba(255,255,255,0.01) !important;
  border-color: rgba(255,255,255,0.14) !important;
  color: var(--text) !important;
  font-weight:650;
  opacity: .92;
  white-space: nowrap;
}
html[data-theme="light"] .cp-back-to-clients{
  background: rgba(11,11,13,0.03) !important;
  border-color: rgba(11,11,13,0.12) !important;
}
@media (hover: hover) and (pointer: fine){
  .cp-back-to-clients:hover{
    background: rgba(230,90,26,0.08) !important;
    border-color: rgba(230,90,26,0.55) !important;
    opacity: 1;
  }
}
html[data-theme="light"] .cp-tabbar-hint{ color: rgba(11,11,13,.55); }
/* Light theme: tabs must remain readable (dark text + subtle backgrounds) */
html[data-theme="light"] .cp-tabbar{
  background: rgba(11,11,13,0.03);
  border-color: rgba(11,11,13,0.08);
  box-shadow: 0 8px 18px rgba(11,11,13,0.06);
}
html[data-theme="light"] .cp-tab{
  background: rgba(11,11,13,0.05);
  border-color: rgba(11,11,13,0.10);
  color: rgba(11,11,13,0.86);
}
html[data-theme="light"] .cp-tab:hover{
  background: rgba(11,11,13,0.08);
}
html[data-theme="light"] .cp-tab.is-active{
  background: linear-gradient(180deg, rgba(255,106,31,0.22), rgba(255,106,31,0.08));
  border-color: rgba(255,106,31,0.45);
  color: rgba(11,11,13,0.92);
  box-shadow: 0 10px 22px rgba(11,11,13,0.12);
}

/* /me: consistent vertical rhythm between sections (cards + tabbar) */
.cp-tabs-scope[data-cp-tabs="me"] .card.card-brand{
  margin-bottom: 14px !important;
}
.cp-tabs-scope[data-cp-tabs="me"] .cp-tabbar{
  margin-bottom: 12px;
}
.cp-tabs-scope[data-cp-tabs="me"] .cp-tabbar-hint{
  margin-bottom: 12px;
}
.cp-tabs-scope[data-cp-tabs="me"] .card.card-brand:last-child{
  margin-bottom: 0 !important;
}
.cp-tab{
  display:inline-flex; align-items:center; gap:.45rem;
  padding:.45rem .8rem;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.88);
  font-weight:600;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.cp-tab:hover{ transform: translateY(-1px); }
.cp-tab.is-active{
  background: linear-gradient(180deg, rgba(255,115,0,.38), rgba(255,115,0,.12));
  border-color: rgba(255,115,0,.45);
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
}

/* /me is server-rendered before cp_tabs.js runs. Keep every non-default panel
   out of the very first paint so cards such as Ankieta cannot flash for one frame
   and then disappear when the tabs controller initializes. */
.cp-tabs-scope[data-cp-tabs="me"]:not(.cp-tabs--enhanced) [data-cp-panel]:not([data-cp-panel="start"]){
  display:none !important;
}

.cp-tabs--enhanced [data-cp-panel]{ display:none; }
.cp-tabs--enhanced [data-cp-panel].is-active{ display:block; }

/* Animate only real user tab changes. The initial tab is painted immediately
   without a second fade/translate pass, which removes the WebView reload blink. */
.cp-tabs--enhanced.cp-tabs--interaction-ready [data-cp-panel].is-active{
  animation: cpFadeUp .22s ease both;
}

@keyframes cpFadeUp{
  from{ opacity:0; transform: translateY(6px); }
  to{ opacity:1; transform: translateY(0); }
}
/* Tablets + phones: keep the tabbar in ONE line (horizontally scrollable).
   On iPad portrait the old wrap caused 2 lines and looked messy. */
@media (max-width: 1200px){
  .cp-tabbar{ overflow-x:auto; flex-wrap:nowrap; -webkit-overflow-scrolling: touch; }
  .cp-tab{ white-space:nowrap; }
  /* On smaller screens do not push "Czat/Ustawienia" to the far right with ms-auto,
     because it creates huge gaps and encourages wrapping. */
  .cp-tabbar .ms-auto{ margin-left: 0 !important; }
}

/* === CoachPro UI: Collapsible blocks (premium focus mode) === */
.cp-collapse-body{
  overflow:hidden;
  max-height:none;
  opacity:1;
  transition: max-height .22s ease, opacity .18s ease;
}
.cp-collapse-body.is-collapsed{
  max-height:0;
  opacity:0;
}
.cp-collapse-toggle{
  display:inline-flex; align-items:center; gap:.5rem;
}
.cp-collapse-toggle .chev{
  display:inline-block;
  width: 1.1rem; height:1.1rem;
  transition: transform .18s ease;
}
.cp-collapse-body.is-collapsed ~ .cp-collapse-footer .chev,
.cp-collapse-toggle[aria-expanded="false"] .chev{
  transform: rotate(-90deg);
}

/* Session LIVE: exercise details are now always visible */
.cp-collapse-body--always-open{
  max-height:none !important;
  opacity:1 !important;
  overflow:visible !important;
}

/* --- Premium insights (reports + report_ready) --- */
.kpi-mini{
  border: 1px solid var(--brand-border, rgba(255,255,255,0.10));
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--card-bg, rgba(255,255,255,0.02));
}
.kpi-mini-label{
  font-size: 11px;
  color: var(--muted, rgba(242,242,243,0.72));
  letter-spacing: .2px;
}
.kpi-mini-value{
  font-weight:700;
  margin-top: 2px;
}
.insights-list{
  margin: 8px 0 0 0;
  padding-left: 18px;
}
.insights-list li{
  margin: 6px 0;
  line-height: 1.25rem;
}



/* Report ready: make insights panel framed (especially visible in light theme) */
.report-insights{
  margin-top: .75rem;
  padding: .85rem .9rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface2);
}
html[data-theme="light"] .report-insights{
  border-color: rgba(11,11,13,0.16);
  background: rgba(11,11,13,0.02);
}
/* Make brand alert look premium in dark mode (avoid white flash blocks) */
html[data-theme="dark"] .alert.alert-brand{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.10);
  color: rgba(242,242,243,0.92);
}

/* Live workout hint chip */
.live-hint{
  border: 1px solid var(--brand-border, rgba(255,255,255,0.10));
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}
.live-hint-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
  margin-top: 4px;
  background: rgba(255,255,255,0.35);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}
.live-hint.is-good .live-hint-dot{ background: rgba(34,197,94,0.92); box-shadow: 0 0 0 3px rgba(34,197,94,0.14); }
.live-hint.is-warn .live-hint-dot{ background: rgba(255,122,26,0.95); box-shadow: 0 0 0 3px rgba(255,122,26,0.16); }
.live-hint.is-bad  .live-hint-dot{ background: rgba(239,68,68,0.95); box-shadow: 0 0 0 3px rgba(239,68,68,0.14); }

.live-hint-icon{ line-height: 1; }
.live-hint-text{ font-size: 12.5px; color: var(--text, #f2f2f3); white-space: pre-line; line-height: 1.25; }

/* Ensure hint stays dark in light mode too */
body.light .live-hint{
  background: rgba(0,0,0,0.03);
  border-color: rgba(11,11,13,0.16);
}
html[data-theme="light"] .live-hint{
  background: rgba(0,0,0,0.03);
  border-color: rgba(11,11,13,0.16);
}
body.light .live-hint-text{ color: #1b1b1d; }


/* Calendar system polish */

.me-cal-btn{ border-radius: 12px; font-weight:700; letter-spacing: .01em; }
.me-cal-slot-btn{ border-radius: 999px; padding: .28rem .65rem; font-weight:700; }
.me-cal-slot-btn.active,
.me-cal-slot-btn[aria-pressed='true']{
  background: rgba(255,122,26,.18);
  border-color: rgba(255,122,26,.55);
  color: var(--text);
}
html[data-theme="light"] .me-cal-slot-btn.active,
html[data-theme="light"] .me-cal-slot-btn[aria-pressed='true']{
  background: rgba(230,90,26,.12);
  border-color: rgba(230,90,26,.45);
}
.training-pill.is-availability{ background: var(--hover); border-color: var(--border); color: var(--text); }

/* Availability ranges as badges (calendar cells + day details) */
.me-cal-av-badges{ display:flex; flex-wrap:wrap; gap:4px; margin-top: 2px; }
.me-cal-av-badge{
  display:inline-flex;
  align-items:center;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight:700;
  line-height: 1.2;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  font-variant-numeric: tabular-nums;
}
html[data-theme="light"] .me-cal-av-badge{ background: rgba(11,11,13,0.04); }
.me-cal-av-badge.is-available{ border-color: rgba(34,197,94,.55); background: rgba(34,197,94,.14); }
.me-cal-av-badge.is-unavailable{ border-color: rgba(239,68,68,.55); background: rgba(239,68,68,.12); }
.me-cal-av-badge.is-more{ color: var(--muted); }

.cp-av-badge-row{ display:flex; flex-wrap:wrap; gap:6px; margin-top: 4px; }
.cp-av-badge{
  display:inline-flex;
  align-items:center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight:700;
  line-height: 1.25;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  font-variant-numeric: tabular-nums;
}
html[data-theme="light"] .cp-av-badge{ background: rgba(11,11,13,0.04); }
.cp-av-badge.is-available{ border-color: rgba(34,197,94,.55); background: rgba(34,197,94,.14); }
.cp-av-badge.is-unavailable{ border-color: rgba(239,68,68,.55); background: rgba(239,68,68,.12); }
.cp-av-badge.is-none{ color: var(--muted); }

.cp-pill-del{ display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; border-radius: 999px; text-decoration:none; margin-left:6px; color: var(--muted); border:1px solid var(--border); }
.cp-pill-del:hover{ color: var(--danger); border-color: rgba(239,68,68,.55); background: rgba(239,68,68,.08); }

/* --- Session LIVE: premium, predictable exercise action buttons (Delete / Video / Expand) --- */
.cp-ex-actions{display:flex;flex-direction:column;align-items:flex-end;gap:.4rem}
.cp-ex-actions form{margin:0}
.cp-ex-actions .btn{white-space:nowrap}
.cp-action-btn{border-radius:12px; padding-left:.55rem; padding-right:.55rem; height:34px; display:inline-flex; align-items:center; gap:.4rem; justify-content:center}
@media (min-width:577px){
  /* Keep a consistent width so the stack looks tidy on desktop/tablet */
  .cp-ex-actions .cp-action-btn{min-width:116px}
  .cp-ex-actions form{width:100%}
}
@media (max-width:576px){
  /* Mobile: icon-only buttons, compact vertical stack */
  .cp-ex-actions{gap:.35rem}
  .cp-ex-actions .btn{padding-left:.55rem;padding-right:.55rem}
  .cp-ex-actions .cp-action-btn{min-width:38px; height:32px}
  .cp-ex-actions .cp-action-btn .chev{margin-right:0}
  .cp-ex-actions form{width:auto}
}

/* --- Billing: plan limits (quota) progress bars --- */
.progress.progress-quota{
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.08);
}
html[data-theme="light"] .progress.progress-quota{
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.06);
}
.progress-bar.progress-bar-quota{
  border-radius: 999px;
  background: linear-gradient(180deg, var(--orange2), var(--orange));
  box-shadow: 0 10px 25px rgba(230,90,26,0.18);
}
.progress-bar.progress-bar-quota-full{
  background: linear-gradient(180deg, #ff4d4d, #d11a2a);
  box-shadow: 0 10px 25px rgba(255,77,77,0.16);
}
