/* ==========================================================================
   2FIT / ClubFit shared design system
   Tokens and components taken from the Figma file (desktop frames 219:2583,
   117:2100, 255:3918, 221:2730, 222:9988, 127:3123).
   Loaded last on every page, so it can adapt the existing mobile pages for
   large screens without changing how they look on phones.
   ========================================================================== */

@font-face { font-family: 'TT Firs Neue'; src: url('../fonts/tt_firs_neue/TT Firs Neue Trial Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'TT Firs Neue'; src: url('../fonts/tt_firs_neue/TT Firs Neue Trial Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'TT Firs Neue'; src: url('../fonts/tt_firs_neue/TT Firs Neue Trial DemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'TT Firs Neue'; src: url('../fonts/tt_firs_neue/TT Firs Neue Trial Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --c-bg: #030e07;
  --c-ink: #041309;
  --c-sidebar: #f0f3ea;
  --c-accent: #77ffa0;
  --c-card: #0f2e18;
  --c-card-deep: #0d2d17;
  --c-nav: #0e3d1d;
  --c-line: rgba(233, 234, 235, 0.2);
  --c-muted: #797979;
  --c-input: #373737;
  --c-search: #626262;
  --c-drawer: #1c1c1c;
  --c-mint: #d9f2e1;
  --c-tooltip: #3a7563;
  --c-danger: #ff6b6b;
  --c-warn: #ffd166;
  --font-display: 'TT Firs Neue', 'Sora', sans-serif;
  --font-body: 'Sora', sans-serif;
  --sidebar-w: 214px;
  --content-w: 1150px;
}

.app-sidebar, .app-sidebar *, .d-page, .d-page *, .d-drawer, .d-drawer *, .d-cal, .d-cal * { box-sizing: border-box; }

/* --------------------------------------------------------------------------
   Mobile bottom navigation (single source of truth for every page)
   -------------------------------------------------------------------------- */
.nav-gradient {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; height: 90px; pointer-events: none;
  background: linear-gradient(180deg, rgba(28,28,28,0) 34.13%, #041309 100%);
  z-index: 1;
}
.bottom-nav {
  position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; justify-content: space-between;
  background-color: var(--c-nav); border-radius: 100px;
  padding: 0.5rem 0.75rem; gap: 0.5rem; z-index: 20;
  border: 1px solid rgba(255,255,255,0.14);
}
.bottom-nav .nav-item {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem; color: #ccc; text-decoration: none;
  border-radius: 100px; padding: 0.5rem;
  transition: background-color 0.2s, color 0.2s;
}
.bottom-nav .nav-item img { width: 24px; height: 24px; object-fit: contain; }
.bottom-nav .nav-item span { display: none; font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.bottom-nav .nav-item.active { background-color: var(--c-ink); color: #fff; padding: 0.5rem 1rem; }
.bottom-nav .nav-item.active span { display: inline-block; }

/* --------------------------------------------------------------------------
   Desktop sidebar (hidden on phones)
   -------------------------------------------------------------------------- */
.app-sidebar { display: none; }

/* Desktop-only / mobile-only helpers */
.d-only { display: none !important; }

@media (min-width: 1024px) {
  .d-only { display: revert !important; }
  .d-only.d-block { display: block !important; }
  .d-only.d-flex { display: flex !important; }
  .m-only { display: none !important; }

  body.has-app-shell { padding-left: var(--sidebar-w); }
  body.has-app-shell .bottom-nav,
  body.has-app-shell .nav-gradient { display: none !important; }

  .app-sidebar {
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
    background: var(--c-sidebar); color: var(--c-ink);
    border-radius: 0 40px 40px 0;
    padding: 40px 24px 28px; z-index: 60;
    font-family: var(--font-display);
    overflow-y: auto;
  }
  .app-sidebar__brand { display: block; padding: 6px 0 0; }
  .app-sidebar__brand img { width: 150px; height: auto; display: block; }
  .app-sidebar__rule { height: 1px; background: rgba(4,19,9,0.12); margin: 30px 0 22px; border: 0; }
  .app-sidebar__nav { display: flex; flex-direction: column; gap: 4px; }
  .app-sidebar__link {
    position: relative; display: flex; align-items: center; gap: 8px;
    padding: 10px 0; color: var(--c-ink); text-decoration: none;
    font-size: 16px; font-weight: 400; opacity: 0.6;
    transition: opacity .15s;
  }
  .app-sidebar__link:hover { opacity: 0.9; }
  .app-sidebar__link img { width: 20px; height: 20px; filter: brightness(0); }
  .app-sidebar__link.is-active { opacity: 1; font-weight: 500; }
  .app-sidebar__link.is-active::before {
    content: ''; position: absolute; left: -24px; top: 50%; transform: translateY(-50%);
    width: 6px; height: 35px; background: #000; border-radius: 0 5px 5px 0;
  }
  .app-sidebar__spacer { flex: 1; }
  .app-sidebar__user {
    display: block; background: var(--c-card-deep); color: #fff; text-decoration: none;
    border-radius: 12px; padding: 12px 13px; margin-bottom: 18px;
  }
  .app-sidebar__user-role { display: flex; align-items: center; gap: 4px; font-size: 14px; opacity: .9; }
  .app-sidebar__user-role img { width: 14px; height: 14px; }
  .app-sidebar__user-name { display: block; font-size: 20px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app-sidebar__logout { display: flex; align-items: center; gap: 8px; color: rgba(11,16,40,0.8); text-decoration: none; font-size: 16px; }
  .app-sidebar__logout svg { width: 18px; height: 18px; }

  /* Generic widening of the existing single-column pages */
  body.has-app-shell .page-container,
  body.has-app-shell .dashboard-container,
  body.has-app-shell .login-container,
  body.has-app-shell .container {
    max-width: var(--content-w);
    margin-left: auto; margin-right: auto;
  }
}

/* --------------------------------------------------------------------------
   Desktop components (prefix d-)
   -------------------------------------------------------------------------- */
.d-page { padding: 58px 38px 80px; max-width: calc(var(--content-w) + 76px); margin: 0 auto; color: #fff; font-family: var(--font-body); }
.d-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 30px; }
.d-title { font-family: var(--font-display); font-weight: 500; font-size: 42px; line-height: 1.15; color: #fff; margin: 0; }
.d-subtitle { font-family: var(--font-body); font-size: 15px; color: #a9b3ab; margin-top: 6px; }

.d-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 44px; }
.d-metric { background: var(--c-card); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.d-metric__icon { width: 48px; height: 48px; border-radius: 10px; background: var(--c-accent); display: flex; align-items: center; justify-content: center; }
.d-metric__icon img { width: 24px; height: 24px; filter: brightness(0); }
.d-metric__label { font-family: var(--font-display); font-size: 14px; line-height: 20px; color: #fff; }
.d-metric__value { font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 38px; color: #fff; margin-top: 8px; }
.d-metric__hint { font-size: 12px; color: #a9b3ab; margin-top: 4px; }

.d-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.d-section-title { font-family: var(--font-display); font-weight: 500; font-size: 22px; line-height: 28px; color: #fff; margin: 0; }

.d-search { display: flex; align-items: center; gap: 8px; background: var(--c-search); border-radius: 100px; padding: 8px 14px; width: 320px; max-width: 100%; box-shadow: 0 1px 2px rgba(10,13,18,0.05); }
.d-search img { width: 18px; height: 18px; }
.d-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #fff; font-family: var(--font-body); font-size: 16px; line-height: 24px; }
.d-search input::placeholder { color: #e6e6e6; }

.d-tabs { display: inline-flex; padding: 3px; border: 1px solid rgba(255,255,255,.7); border-radius: 100px; gap: 2px; }
.d-tab { border: 0; background: transparent; color: #fff; font-family: var(--font-body); font-size: 16px; padding: 8px 36px; border-radius: 100px; cursor: pointer; }
.d-tab.is-active { background: var(--c-accent); color: var(--c-bg); font-weight: 600; }

.d-table { width: 100%; border-collapse: collapse; font-family: var(--font-body); }
.d-table th { text-align: left; font-weight: 600; font-size: 12px; line-height: 18px; color: var(--c-muted); height: 44px; border-bottom: 1px solid var(--c-line); padding: 0 24px 0 0; white-space: nowrap; }
.d-table th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.d-table th button::after { content: '⇅'; font-size: 11px; opacity: .8; }
.d-table td { height: 72px; border-bottom: 1px solid var(--c-line); padding: 0 24px 0 0; font-size: 14px; line-height: 20px; color: #fff; vertical-align: middle; }
.d-table tr[data-href], .d-table tr.is-clickable { cursor: pointer; }
.d-table tbody tr:hover td { background: rgba(255,255,255,0.03); }
.d-table td.d-actions { width: 1%; white-space: nowrap; padding-right: 0; text-align: right; }
.d-person { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.d-avatar { width: 40px; height: 40px; border-radius: 200px; object-fit: cover; background: #cfd4c6; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; color: var(--c-bg); font-weight: 600; font-family: var(--font-display); border: .75px solid rgba(0,0,0,.08); }
.d-thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: #dadcd6; flex: 0 0 auto; }
.d-empty { padding: 40px 0; text-align: center; color: #a9b3ab; }

.d-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 100px; font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap; }
.d-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.d-pill--active { background: var(--c-accent); color: var(--c-card); }
.d-pill--grace  { background: #cfd4c6; color: #283228; }
.d-pill--warn   { background: var(--c-warn); color: #3b2c00; }
.d-pill--off    { background: rgba(255,255,255,.12); color: #d7d7d7; }
.d-pill--danger { background: #ffd2d2; color: #7a1010; }

.d-icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; vertical-align: middle; }
.d-icon-btn img, .d-icon-btn svg { width: 18px; height: 18px; }
.d-icon-btn:hover, .d-icon-btn:focus-visible { background: #fafafa; outline: none; }
.d-icon-btn:hover svg { stroke: var(--c-bg); }
.d-icon-btn[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--c-tooltip); color: #fff; font: 600 12px/18px var(--font-body); padding: 6px 10px; border-radius: 8px; white-space: nowrap;
  box-shadow: 0 12px 16px rgba(10,13,18,0.08), 0 4px 6px rgba(10,13,18,0.03); z-index: 5;
}

.d-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 100px; padding: 10px 18px; font: 600 14px/20px var(--font-body); cursor: pointer; text-decoration: none; border: 1px solid transparent; white-space: nowrap; }
.d-btn img, .d-btn svg { width: 18px; height: 18px; }
.d-btn--primary { background: var(--c-accent); color: var(--c-bg); }
.d-btn--primary:hover { filter: brightness(1.05); }
.d-btn--outline { background: transparent; color: #fff; border-color: #fff; }
.d-btn--outline:hover { background: rgba(255,255,255,.06); }
.d-btn--danger { background: var(--c-danger); color: #2a0606; }
.d-btn--ghost { background: rgba(255,255,255,.08); color: #fff; }
.d-btn[disabled] { opacity: .45; cursor: not-allowed; }
.d-btn--lg { padding: 13px 28px; font-size: 16px; }

.d-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 20px; }
.d-pages { display: flex; gap: 2px; }
.d-page-btn { width: 40px; height: 40px; border-radius: 8px; border: 0; background: transparent; color: var(--c-muted); font: 500 14px var(--font-body); cursor: pointer; }
.d-page-btn.is-active { background: var(--c-accent); color: var(--c-bg); }

/* Drawer (right side panel) */
.d-drawer-backdrop { position: fixed; inset: 0; background: rgba(3,14,7,0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 900; opacity: 0; pointer-events: none; transition: opacity .2s; }
.d-drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
.d-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(631px, 100vw); background: var(--c-drawer); border-left: 2px solid #fff; z-index: 901; color: #fff; display: flex; flex-direction: column; transform: translateX(105%); transition: transform .25s ease; font-family: var(--font-body); }
.d-drawer.is-open { transform: none; }
.d-drawer__head { padding: 43px 58px 0; position: relative; }
.d-drawer__title { font: 500 32px/1.15 var(--font-display); margin: 0; }
.d-drawer__subtitle { font-size: 18px; margin-top: 4px; color: #fff; }
.d-drawer__close { position: absolute; top: 48px; right: 41px; width: 32px; height: 32px; border: 0; background: transparent; cursor: pointer; padding: 4px; }
.d-drawer__close svg { width: 22px; height: 22px; stroke: #fff; }
.d-drawer__body { flex: 1; overflow-y: auto; padding: 0 58px; }
.d-drawer__rule { height: 1px; background: rgba(255,255,255,0.2); border: 0; margin: 24px 0; }
.d-drawer__foot { padding: 24px 58px 40px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; border-top: 1px solid rgba(255,255,255,0.2); margin: 0 58px; padding-left: 0; padding-right: 0; }

.d-profile { display: flex; align-items: center; gap: 14px; }
.d-profile img, .d-profile .d-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; font-size: 24px; }
.d-profile__name { font: 600 20px/1.2 var(--font-display); }
.d-profile__meta { font-size: 13px; color: #d4d4d4; margin-top: 4px; }
.d-profile__meta b { color: #fff; font-weight: 600; }
.d-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.d-chip { background: #373737; border-radius: 12px; padding: 10px 14px; min-width: 100px; }
.d-chip small { display: block; font-size: 11px; color: #a6a6a6; }
.d-chip strong { display: block; font: 500 16px/1.3 var(--font-display); margin-top: 2px; }
.d-list { display: flex; flex-direction: column; gap: 8px; }
.d-card-mint { background: var(--c-mint); color: #1b1a1f; border-radius: 20px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.d-card-mint__icon { width: 40px; height: 40px; border-radius: 50%; background: var(--c-drawer); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.d-card-mint__icon img { width: 16px; height: 16px; }
.d-card-mint__title { font: 500 16px/1.2 var(--font-display); }
.d-card-mint__sub { font-size: 12px; color: #484848; margin-top: 2px; }
.d-card-mint .d-pill { margin-left: auto; }

/* Forms inside drawers */
.d-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.d-field label { font-size: 14px; }
.d-input { background: var(--c-input); border: 0; border-radius: 100px; padding: 10px 14px; color: #fff; font: 16px/24px var(--font-body); outline: none; }
.d-input::placeholder { color: #828790; }

/* Toast */
.d-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--c-card); color: #fff; border: 1px solid var(--c-accent); padding: 10px 18px; border-radius: 100px; font: 500 14px var(--font-body); z-index: 1000; opacity: 0; transition: opacity .2s; pointer-events: none; }
.d-toast.is-show { opacity: 1; }

@media (max-width: 1280px) and (min-width: 1024px) {
  .d-title { font-size: 34px; }
  .d-page { padding: 44px 28px 64px; }
}
@media (max-width: 1023px) {
  .d-metrics { grid-template-columns: 1fr; gap: 10px; margin-bottom: 28px; }
  .d-metric { flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; }
  .d-metric__icon { width: 40px; height: 40px; flex: 0 0 auto; }
  .d-metric__value { font-size: 22px; line-height: 28px; margin-top: 2px; }
  .d-drawer__head { padding: 28px 22px 0; }
  .d-drawer__close { top: 30px; right: 16px; }
  .d-drawer__body { padding: 0 22px; }
  .d-drawer__foot { margin: 0 22px; flex-wrap: wrap; }
  .d-drawer__foot .d-btn--lg { padding: 12px 18px; flex: 1 1 auto; }
}

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.d-icon-btn { color: #fff; }
.d-icon-btn:hover, .d-icon-btn:focus-visible { color: var(--c-bg); }
.d-pagination[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Library (Figma 255:3918 "Video Library") — the existing cards become rows
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  .page-library .page-container { position: relative; padding: 58px 38px 80px; max-width: calc(var(--content-w) + 76px); }
  .page-library .top-bar { position: static; background: none; padding: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; row-gap: 34px; margin-bottom: 18px; }
  .page-library .top-row { grid-column: 1 / -1; padding-right: 260px; }
  .page-library .back-button { display: none; }
  .page-library .top-row .title { text-align: left; font: 500 42px/1.15 var(--font-display); }
  .page-library .count-row { text-align: left; font: 500 22px/28px var(--font-display); }
  .page-library .search-row { position: relative; }
  .page-library .video-search-input { width: 320px; background: var(--c-search) url('../images/search.svg') no-repeat 16px center; padding: 8px 14px 8px 42px; font-family: var(--font-body); }
  .page-library .video-search-input::placeholder { color: #e6e6e6; }
  .page-library .filter-button { background: var(--c-search); }
  .page-library .add-video-btn { position: absolute; top: 58px; right: 38px; bottom: auto; left: auto; transform: none; border-radius: 100px; padding: 12px 20px; font: 600 14px/20px var(--font-body); color: var(--c-bg); }

  .page-library.lib-list .lib-head,
  .page-library.lib-list .video-card { display: grid !important; grid-template-columns: 72px minmax(0, 1fr) 200px 140px 36px 36px; align-items: center; column-gap: 14px; }
  .page-library.lib-list .lib-head { height: 44px; border-bottom: 1px solid var(--c-line); font: 600 12px/18px var(--font-body); color: var(--c-muted); }
  .page-library.lib-list .videos-grid { display: block; margin-bottom: 40px; }
  .page-library.lib-list .video-card { height: 108px; border-bottom: 1px solid var(--c-line); }
  .page-library.lib-list .video-card:hover { background: rgba(255,255,255,0.03); }
  .page-library.lib-list .video-thumb { grid-column: 1; grid-row: 1; width: 72px; height: 90px; aspect-ratio: auto; object-fit: cover; border-radius: 12px; cursor: pointer; }
  .page-library.lib-list .video-title { grid-column: 2; grid-row: 1; margin: 0; text-align: left; font: 600 15px/20px var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .page-library.lib-list .edit-title-input { grid-column: 2; grid-row: 1; margin: 0; text-align: left; }
  .page-library.lib-list .vc-cat { grid-column: 3; grid-row: 1; font-size: 14px; }
  .page-library.lib-list .vc-date { grid-column: 4; grid-row: 1; font-size: 14px; color: #d8d8d8; }
  .page-library.lib-list .delete-video-btn { grid-column: 5; grid-row: 1; position: static; width: 32px; height: 32px; background: transparent; border-radius: 8px; }
  .page-library.lib-list .delete-video-btn:hover { background: #fafafa; }
  .page-library.lib-list .vc-edit { grid-column: 6; grid-row: 1; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer; display: inline-flex !important; align-items: center; justify-content: center; }
  .page-library.lib-list .vc-edit svg { width: 18px; height: 18px; }
  .page-library.lib-list .vc-edit:hover { background: #fafafa; color: var(--c-bg); }

  /* ---- Library toolbar: category chips + grid/list switch ---- */
  .page-library .lib-toolbar { display: flex !important; align-items: center; gap: 16px; margin: 4px 0 22px; }
  .page-library .lib-chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
  .page-library .lib-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 6px; border-radius: 999px; border: 1px solid var(--c-line); background: rgba(255,255,255,.03); color: #fff; font: 500 13px/1 var(--font-body); cursor: pointer; transition: background .15s, border-color .15s; }
  .page-library .lib-chip.no-icon { padding-left: 14px; }
  .page-library .lib-chip img { width: 26px; height: 26px; }
  .page-library .lib-chip b { font-weight: 600; color: var(--c-muted); }
  .page-library .lib-chip:hover { border-color: rgba(255,255,255,.35); }
  .page-library .lib-chip.is-active { background: var(--c-accent, #77FFA0); border-color: var(--c-accent, #77FFA0); color: var(--c-bg); }
  .page-library .lib-chip.is-active b { color: rgba(3,14,7,.6); }
  .page-library .lib-view { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.06); flex: 0 0 auto; }
  .page-library .lib-view button { width: 34px; height: 30px; border: 0; border-radius: 9px; background: transparent; color: #cfd6d1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
  .page-library .lib-view button svg { width: 17px; height: 17px; }
  .page-library .lib-view button.is-active { background: #fff; color: var(--c-bg); }
  .page-library .filter-button, .page-library #filter-dropdown { display: none !important; }

  /* ---- Grid view (default) ---- */
  .page-library:not(.lib-list) .lib-head { display: none !important; }
  .page-library:not(.lib-list) .videos-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; margin-bottom: 48px; }
  .page-library:not(.lib-list) .video-card {
    display: grid !important; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; align-items: start;
    position: relative; padding: 0 0 14px; border-radius: 20px; overflow: hidden; background: #0B1A10; border: 1px solid var(--c-line); height: auto;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  }
  .page-library:not(.lib-list) .video-card:hover { transform: translateY(-3px); border-color: rgba(119,255,160,.45); box-shadow: 0 14px 34px rgba(0,0,0,.35); }
  .page-library:not(.lib-list) .video-thumb { grid-area: 1 / 1; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 0; cursor: pointer; background: #101a13; transition: transform .35s ease; }
  .page-library:not(.lib-list) .video-card:hover .video-thumb { transform: scale(1.03); }
  .page-library:not(.lib-list) .vc-play {
    grid-area: 1 / 1; align-self: center; justify-self: center; width: 52px; height: 52px; border-radius: 50%; pointer-events: none;
    display: inline-flex !important; align-items: center; justify-content: center; background: rgba(3,14,7,.55); color: #fff;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transform: scale(.85); transition: opacity .2s, transform .2s;
  }
  .page-library:not(.lib-list) .vc-play svg { width: 20px; height: 20px; margin-left: 3px; }
  .page-library:not(.lib-list) .video-card:hover .vc-play { opacity: 1; transform: none; }
  .page-library:not(.lib-list) .vc-cat {
    grid-area: 1 / 1; align-self: end; justify-self: start; margin: 0 0 10px 10px; z-index: 1; pointer-events: none;
    display: inline-flex !important; align-items: center; gap: 6px; max-width: calc(100% - 20px); height: 30px; padding: 0 12px 0 3px; border-radius: 999px;
    background: rgba(3,14,7,.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font: 600 12px/1 var(--font-body); color: #fff; white-space: nowrap;
  }
  .page-library:not(.lib-list) .vc-cat.no-icon { padding-left: 12px; }
  .page-library:not(.lib-list) .vc-cat img { width: 24px; height: 24px; flex: 0 0 auto; }
  .page-library:not(.lib-list) .vc-cat span { overflow: hidden; text-overflow: ellipsis; }
  .page-library:not(.lib-list) .delete-video-btn,
  .page-library:not(.lib-list) .vc-edit {
    grid-area: 1 / 1; align-self: start; z-index: 2; position: static; margin-top: 10px; width: 34px; height: 34px; border-radius: 10px; border: 0;
    display: inline-flex !important; align-items: center; justify-content: center; cursor: pointer;
    background: rgba(3,14,7,.72); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    opacity: 0; transition: opacity .15s, background .15s;
  }
  .page-library:not(.lib-list) .vc-edit { justify-self: end; margin-right: 52px; }
  .page-library:not(.lib-list) .delete-video-btn { justify-self: end; margin-right: 10px; }
  .page-library:not(.lib-list) .delete-video-btn img { width: 18px; height: 18px; }
  .page-library:not(.lib-list) .vc-edit svg { width: 16px; height: 16px; }
  .page-library:not(.lib-list) .video-card:hover .delete-video-btn,
  .page-library:not(.lib-list) .video-card:hover .vc-edit,
  .page-library:not(.lib-list) .video-card:focus-within .delete-video-btn,
  .page-library:not(.lib-list) .video-card:focus-within .vc-edit { opacity: 1; }
  .page-library:not(.lib-list) .delete-video-btn:hover { background: #ff6b6b; }
  .page-library:not(.lib-list) .vc-edit:hover { background: #fff; color: var(--c-bg); }
  .page-library:not(.lib-list) .video-title,
  .page-library:not(.lib-list) .edit-title-input { grid-row: 2; grid-column: 1; margin: 12px 14px 0; text-align: left; font: 600 15px/1.3 var(--font-body); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: text; }
  .page-library:not(.lib-list) .vc-date { grid-row: 3; grid-column: 1; margin: 4px 14px 0; font-size: 12px; color: var(--c-muted); display: block !important; }
  .page-library:not(.lib-list) .vc-date::before { content: "Качено "; }
  .page-library .lib-empty { grid-column: 1 / -1; padding: 60px 0; text-align: center; color: var(--c-muted); }
  /* list view: hide grid-only bits */
  .page-library.lib-list .vc-play { display: none !important; }
  .page-library.lib-list .vc-cat { display: inline-flex !important; align-items: center; gap: 8px; }
  .page-library.lib-list .vc-cat img { width: 24px; height: 24px; }

  /* Upload form becomes the right-hand drawer from the Figma file */
  .page-library .modal-vu { justify-content: flex-end; background: rgba(3,14,7,0.7); backdrop-filter: blur(6px); }
  .page-library .modal-content-vu { width: 631px; max-width: 100vw; height: 100%; overflow-y: auto; background: var(--c-drawer); border-left: 2px solid #fff; padding: 43px 58px; }
  .page-library .modal-content-vu > h2 { font: 500 32px/1.15 var(--font-display); margin-bottom: 24px; text-align: left; }

  /* Video preview/edit: a centred portrait player instead of a stretched full-screen one */
  .page-library .video-player-modal { background: rgba(3,14,7,0.88); backdrop-filter: blur(6px); align-items: center; justify-content: center; }
  .page-library .video-player-stage { position: relative !important; width: min(440px, 40vw) !important; height: min(86vh, 860px) !important; border-radius: 24px; overflow: hidden; background: #000; border: 1px solid rgba(255,255,255,.2); }
  .page-library #fullscreen-video { position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; object-fit: cover; }
  .page-library .video-player-stage .video-overlay-controls,
  .page-library .video-player-stage .modal-player-controls { left: 12px !important; right: 12px !important; width: auto !important; max-width: none !important; }
}

/* --------------------------------------------------------------------------
   Planner (Figma 221:2730 "Schedule Workout" + 222:9988 drawer)
   -------------------------------------------------------------------------- */
.d-cal { background: #fff; border-radius: 12px; overflow: hidden; color: var(--c-bg); font-family: var(--font-body); }
.d-cal__bar { background: var(--c-card); color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 20px; }
.d-cal__today { width: 64px; border-radius: 8px; overflow: hidden; text-align: center; border: 1px solid rgba(255,255,255,.25); flex: 0 0 auto; }
.d-cal__today span { display: block; background: rgba(255,255,255,.35); font: 600 11px/20px var(--font-body); color: #e9eaeb; }
.d-cal__today strong { display: block; background: rgba(255,255,255,.18); font: 700 18px/30px var(--font-body); }
.d-cal__label { flex: 1; min-width: 0; }
.d-cal__month { font: 500 18px/28px var(--font-display); display: flex; align-items: center; gap: 8px; }
.d-cal__week { background: #fff; color: var(--c-bg); border-radius: 100px; padding: 0 8px; font: 500 12px/20px var(--font-body); }
.d-cal__range { font-size: 14px; color: #a4a7ae; }
.d-cal__nav { display: flex; align-items: center; gap: 8px; }
.d-cal__arrow { height: 40px; min-width: 40px; padding: 0 12px; border-radius: 100px; border: 1px solid rgba(255,255,255,.5); background: transparent; color: #fff; cursor: pointer; font: 600 14px var(--font-body); display: inline-flex; align-items: center; justify-content: center; }
.d-cal__arrow svg { width: 18px; height: 18px; }
.d-cal__arrow:hover { background: rgba(255,255,255,.08); }
.d-cal__nav .d-btn { margin-left: 8px; }
.d-cal__weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid #e9eaeb; }
.d-cal__weekdays span { text-align: center; font: 600 12px/28px var(--font-body); color: #535862; border-right: 1px solid #e9eaeb; }
.d-cal__weekdays span:last-child { border-right: 0; }
.d-cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.d-cal__cell { min-height: 128px; border-right: 1px solid #e9eaeb; border-bottom: 1px solid #e9eaeb; padding: 8px; display: flex; flex-direction: column; gap: 6px; background: #fff; }
.d-cal__cell:nth-child(7n) { border-right: 0; }
.d-cal__cell.is-out { background: #fafafa; }
.d-cal__cell.is-out .d-cal__num { color: #a4a7ae; }
.d-cal__num { font: 600 12px/24px var(--font-body); color: #414651; width: 24px; height: 24px; text-align: center; border-radius: 50%; }
.d-cal__cell.is-today .d-cal__num { background: var(--c-accent); color: var(--c-bg); }
.d-cal__pill { display: flex; align-items: center; background: #cfd4c6; border-radius: 100px; min-width: 0; }
.d-cal__pill.is-past { background: #eef0eb; color: #6b6f68; }
.d-cal__pill-text { all: unset; flex: 1; min-width: 0; padding: 4px 10px; font: 500 12px/18px var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.d-cal__pill:hover { background: #77ffa0; color: #030e07; }
.d-cal__pill.is-past:hover { background: #dfe6da; color: #3b3f3a; }
.d-cal__pill-del { all: unset; display: none; flex: 0 0 22px; width: 22px; height: 22px; margin-right: 2px; border-radius: 50%; text-align: center; font: 600 15px/22px var(--font-body); color: #4b514a; cursor: pointer; }
.d-cal__pill:hover .d-cal__pill-del, .d-cal__pill:focus-within .d-cal__pill-del { display: block; }
.d-cal__pill-del:hover { background: #ff6b6b; color: #fff; }
.d-cal__pill-edit { all: unset; display: none; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; color: #2b302a; cursor: pointer; align-items: center; justify-content: center; }
.d-cal__pill-edit svg { width: 13px; height: 13px; }
.d-cal__pill:hover .d-cal__pill-edit, .d-cal__pill:focus-within .d-cal__pill-edit { display: inline-flex; }
.d-cal__pill-edit:hover { background: rgba(3,14,7,.12); }
.d-cal__pill-text:focus-visible, .d-cal__add:focus-visible { outline: 2px solid var(--c-card); outline-offset: 2px; }
.d-cal__add { margin-top: auto; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--c-bg); background: #fff; color: var(--c-bg); border-radius: 100px; padding: 5px 8px; font: 600 12px/18px var(--font-body); cursor: pointer; opacity: 0; transition: opacity .15s; }
.d-cal__add svg { width: 14px; height: 14px; }
.d-cal__cell:hover .d-cal__add, .d-cal__add:focus-visible, .d-cal__cell.is-today .d-cal__add { opacity: 1; }
.d-cal__add:hover { background: var(--c-accent); }

@media (min-width: 1024px) {
  /* Existing create/edit form shown as the Figma right-hand drawer */
  .page-planner #create-workout-modal { left: auto; right: 0; width: 631px; max-width: 100vw; background: var(--c-drawer); border-left: 2px solid #fff; z-index: 950; }
  .page-planner #create-workout-modal .modal-top-bar { padding: 43px 58px 18px; grid-template-columns: 1fr 40px; border-bottom: 1px solid rgba(255,255,255,.2); margin: 0 0 24px; }
  .page-planner #create-workout-modal .modal-back-btn { grid-column: 2; grid-row: 1; width: 32px; }
  .page-planner #create-workout-modal .modal-title { grid-column: 1; grid-row: 1; text-align: left; font: 500 32px/1.15 var(--font-display); }
  .page-planner #create-workout-modal .modal-content { padding: 0 58px 40px; }
  /* The date is picked on the big calendar, so the small one is hidden */
  .page-planner #create-workout-modal .step-block:first-child { display: none; }
  .page-planner .planner-backdrop { z-index: 940; }
  .page-planner #exercise-dropup { left: auto !important; right: 0 !important; width: 631px !important; max-width: 100vw; }
  .page-planner #loader-overlay { z-index: 10000; }
}

/* --------------------------------------------------------------------------
   Desktop adaptations of the existing client / profile / auth pages
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  /* Client home */
  .page-dashboard .dashboard-container { max-width: calc(var(--content-w) + 76px); padding: 46px 38px 80px; }
  .page-dashboard .recommended-slider { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); overflow: visible; margin: 0 0 2.5rem; padding: 0; }
  .page-dashboard .recommended-card { width: auto; }
  .page-dashboard .free-workout-section { aspect-ratio: 21 / 8; max-height: 440px; }
  .page-dashboard .trainer-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .page-dashboard .trainer-cards > * { margin: 0 !important; }

  /* Client workout of the day */
  /* Two columns: week strip on top, workout video + exercises left, coach right */
  html:has(body.page-workout), body.page-workout { height: auto !important; overflow: visible !important; }
  .page-workout .page-container { max-width: calc(var(--content-w) + 76px); margin: 0 auto; padding: 52px 38px 80px;
    display: grid; grid-template-columns: minmax(0, 1fr) 320px; column-gap: 28px; align-items: start; }
  .page-workout .page-container > * { grid-column: 1; margin-left: 0; margin-right: 0; }
  .page-workout .top-section, .page-workout .section-divider { display: none !important; }
  .page-workout .date-section { display: contents; }
  .page-workout .date-heading { grid-column: 1 / -1; grid-row: 1; display: flex; align-items: baseline; gap: 16px; margin: 0 0 22px; }
  .page-workout .date-heading .day-name { font: 500 40px/1.1 var(--font-display); margin: 0; text-transform: capitalize; }
  .page-workout .date-heading .full-date { color: #a9b3ab; font-size: 16px; }
  .page-workout .date-row { grid-column: 1 / -1; grid-row: 2; display: grid !important; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin: 0 0 32px; }
  .page-workout .date-box { height: 84px !important; width: auto !important; border-radius: 18px !important; cursor: pointer; transition: transform .12s, background .12s; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
  .page-workout .date-box:hover { transform: translateY(-2px); }
  .page-workout .date-box .date-day { font-size: 13px !important; }
  .page-workout .date-box .date-num { font: 500 24px var(--font-display) !important; }
  .page-workout .workout-date-header { grid-row: 3; font: 500 24px var(--font-display) !important; margin: 0 0 14px !important; }
  .page-workout .daily-workout-section { grid-row: 4; aspect-ratio: 16 / 9; max-height: none; border-radius: 26px !important; margin: 0 !important; }
  .page-workout .daily-workout-section .workout-title { font-size: 30px !important; }
  .page-workout .complete-wrap { grid-row: 5; margin: 18px 0 8px !important; text-align: left; display: flex; align-items: center; gap: 16px; }
  .page-workout .complete-wrap[hidden] { display: none !important; }
  .page-workout .complete-msg { margin: 0; }
  .page-workout .additional-workouts { grid-row: 6; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; margin-top: 18px; }
  .page-workout .page-container > .trainer-count:not(.workout-date-header) { grid-column: 2; grid-row: 3; font: 500 24px var(--font-display) !important; margin: 0 0 14px !important; }
  .page-workout .page-container > .trainer-card { grid-column: 2; grid-row: 4; align-self: start; margin: 0 !important; border-radius: 22px; position: sticky; top: 28px; }

  /* Trainer / client lists become two-column grids */
  .page-list .page-container { max-width: calc(var(--content-w) + 76px); padding: 46px 38px 80px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; align-content: start; }
  .page-list .page-container > * { grid-column: 1 / -1; }
  .page-list .page-container > .trainer-card { grid-column: auto; margin: 0 0 16px !important; }
  .page-list .app-header { margin-top: 0; }
  .page-clients .clients-section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .page-clients .clients-section > * { margin: 0 !important; }

  /* Profile-style pages keep their mobile composition as a centred column */
  body.page-profile .page-container { max-width: 720px; margin: 0 auto; overflow: hidden; }
  .page-profile .shapes-top, .page-profile .grid-container, .page-profile .shape-container, .page-profile .pattern-container { width: 100% !important; }
  .page-profile .shapes-top img, .page-profile .shapes-top svg { max-width: 100%; }
  .page-trainer-profile .subscription-container { left: var(--sidebar-w); width: auto; right: 0; }
  .page-profile .modal { left: var(--sidebar-w); }

  /* Help page */
  .page-info .container, .page-info .support-container { max-width: 760px; margin-left: auto; margin-right: auto; }
  .page-info .container { padding-top: 46px; }
}

/* Auth pages (Figma 127:3123): centred form on the grid pattern */
@media (min-width: 900px) {
  body.page-auth { background: var(--c-bg) url('../images/pattern-desktop.svg') center -80px / 1200px auto no-repeat; }
  body.page-auth .login-container { max-width: 420px; margin: 0 auto; padding-top: 8vh; padding-bottom: 8vh; min-height: 0; }
  .page-auth .login-container form { flex: none; }
  .page-auth .login-container form button[type=submit], .page-auth .login-container form .login-btn { margin-top: 24px; }
}

/* Cookie notice */
.cookie-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 800; max-width: 560px; margin: 0 auto; background: var(--c-drawer); color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 18px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; font: 14px/1.5 var(--font-body); box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.cookie-bar p { margin: 0; flex: 1; }
.cookie-bar a { color: var(--c-accent); }
.cookie-bar .d-btn { flex: 0 0 auto; padding: 8px 16px; }
body.has-app-shell .cookie-bar { bottom: 96px; }
@media (min-width: 1024px) { body.has-app-shell .cookie-bar { bottom: 16px; left: calc(var(--sidebar-w) + 16px); } }

/* Coach onboarding checklist */
.cl { background: var(--c-card); border: 1px solid rgba(119,255,160,.25); border-radius: 20px; padding: 20px; margin: 0 0 28px; color: #fff; font-family: var(--font-body); }
.cl__head { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.cl__title { font: 600 20px/1.2 var(--font-display); margin: 0 0 4px; }
.cl__sub { margin: 0; color: #c7cec9; font-size: 14px; }
.cl__pct { --p: 0; flex: 0 0 auto; width: 58px; height: 58px; border-radius: 50%; background: conic-gradient(var(--c-accent) calc(var(--p) * 1%), rgba(255,255,255,.12) 0); display: flex; align-items: center; justify-content: center; }
.cl__pct span { width: 46px; height: 46px; border-radius: 50%; background: var(--c-card); display: flex; align-items: center; justify-content: center; font: 600 14px var(--font-display); }
.cl__list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 4px; }
.cl__list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.08); }
.cl__dot { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.cl__list li.is-done .cl__dot { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-bg); }
.cl__list li.is-done .cl__text strong { text-decoration: line-through; opacity: .6; }
.cl__text { flex: 1; min-width: 0; }
.cl__text strong { display: block; font-weight: 500; font-size: 14px; }
.cl__text small { color: #a9b3ab; font-size: 12px; }
.cl__go { color: var(--c-accent); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.cl__wait { color: var(--c-warn); font-size: 12px; }
@media (min-width: 1024px) { .cl__list { grid-template-columns: 1fr 1fr; column-gap: 28px; } }

/* Email verification reminder */
.verify-banner { position: fixed; left: 12px; right: 12px; bottom: 96px; z-index: 790; background: #1c1c1c; color: #fff; border: 1px solid rgba(119,255,160,.45); border-radius: 14px; padding: 10px 14px; font: 14px/1.4 var(--font-body, sans-serif); box-shadow: 0 8px 24px rgba(0,0,0,.4); display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.verify-banner a { color: #77ffa0; font-weight: 600; white-space: nowrap; }
@media (min-width: 1024px) { .verify-banner { left: auto; right: 24px; bottom: 24px; max-width: 420px; } }

/* Workout "mark as done" */
.complete-wrap { margin: 18px 0 110px; text-align: center; }
@media (min-width: 1024px) { .complete-wrap { margin-bottom: 24px; } }
.complete-wrap[hidden] { display: none; }
.complete-btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 26px; border-radius: 999px; border: 2px solid #77ffa0; background: transparent; color: #77ffa0; font: 600 16px var(--font-display, sans-serif); cursor: pointer; transition: background .15s, color .15s; }
.complete-btn:hover { background: rgba(119,255,160,.12); }
.complete-btn__tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid currentColor; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; }
.complete-btn.is-done { background: #77ffa0; color: #030e07; }
.complete-btn:disabled { opacity: .6; cursor: wait; }
.complete-msg { min-height: 1.4em; margin: 10px 0 0; color: #c7cec9; font-size: 14px; }

/* Athlete progress strip (dashboard) */
.progress-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 18px; text-decoration: none; color: #fff; }
.progress-strip__item { background: #0f2e18; border-radius: 18px; padding: 12px 10px; text-align: center; border: 1px solid rgba(119,255,160,.15); }
.progress-strip__item strong { display: block; font: 600 22px/1.1 var(--font-display, sans-serif); color: #77ffa0; }
.progress-strip__item strong em { font-style: normal; font-size: 14px; color: #a9b3ab; margin-left: 2px; }
.progress-strip__item small { color: #c7cec9; font-size: 12px; }
.progress-strip:hover .progress-strip__item { border-color: rgba(119,255,160,.45); }

/* Account settings + history (profile pages) */
.acct, .hist { text-align: left; margin: 26px 0 0; color: #fff; font-family: var(--font-body, sans-serif); }
.acct__title, .hist__title { font: 600 18px var(--font-display, sans-serif); margin: 0 0 12px; }
.acct__row { background: #0f2e18; border-radius: 18px; padding: 14px 16px; margin: 0 0 10px; }
.acct__switch { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.acct__switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.acct__track { flex: 0 0 auto; width: 44px; height: 26px; border-radius: 26px; background: #373737; position: relative; transition: background .15s; }
.acct__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.acct__switch input:checked + .acct__track { background: #77ffa0; }
.acct__switch input:checked + .acct__track::after { transform: translateX(18px); background: #030e07; }
.acct__switch input:focus-visible + .acct__track { outline: 2px solid #fff; outline-offset: 2px; }
.acct__switch strong { display: block; font-weight: 600; }
.acct__switch small, .acct__danger p { color: #a9b3ab; font-size: 13px; line-height: 1.45; }
.acct__danger { border: 1px solid rgba(255,107,107,.35); border-radius: 18px; padding: 12px 16px; }
.acct__danger summary { cursor: pointer; color: #ff9b9b; font-weight: 600; list-style: none; }
.acct__danger summary::-webkit-details-marker { display: none; }
.acct__danger summary::after { content: " ›"; }
.acct__danger[open] summary::after { content: " ⌄"; }
.acct__field { display: block; font-size: 13px; color: #c7cec9; margin: 10px 0; }
.acct__field input { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.2); background: #1c1c1c; color: #fff; font-size: 15px; }
.acct__check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: #c7cec9; margin: 0 0 14px; }
.acct__error { background: rgba(255,107,107,.12); border: 1px solid rgba(255,107,107,.5); color: #ffd2d2; border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.acct__ok { color: #77ffa0; font-size: 14px; }
.hist__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 12px; }
.hist__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hist__list li { display: flex; justify-content: space-between; gap: 12px; background: #0f2e18; border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.hist__list small { color: #a9b3ab; display: block; }
.hist__date { color: #77ffa0; white-space: nowrap; font-weight: 600; }
.hist__empty { color: #a9b3ab; font-size: 14px; }
@media (min-width: 1024px) { .d-metrics--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.d-activity { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin: 0 0 8px; }
.d-activity span { aspect-ratio: 1; border-radius: 4px; background: rgba(255,255,255,.08); }
.d-activity span.is-on { background: #77ffa0; }
.d-activity-legend { display: flex; justify-content: space-between; font-size: 12px; color: #a9b3ab; }
@media (max-width: 1023px) { .acct { margin-bottom: 120px; } }

/* Client details: payments */
.cp-h { font: 500 18px var(--font-display); margin: 28px 0 12px; }
.cp-h--first { margin-top: 28px; }
.cp-muted { margin: 0 0 10px; color: #c7cec9; font-size: 14px; }
.cp-pay { margin: 14px 0 0; display: grid; gap: 0; }
.cp-pay__row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.cp-pay__row:last-child { border-bottom: 0; }
.cp-pay dt { color: #a9b3ab; font-size: 14px; }
.cp-pay dd { margin: 0; text-align: right; }
.cp-pay dd strong { display: block; font: 500 18px/1.2 var(--font-display); color: #fff; }
.cp-pay dd span { display: block; font-size: 12px; color: #a9b3ab; margin-top: 2px; }
.cp-pay__row--main dd strong { font-size: 22px; color: var(--c-accent); }
.cp-pay strong.is-warn { color: #ffd166; }
@media (min-width: 1024px) { .cp-card .cp-col--billing .cp-h--first { margin-top: 0; } }

/* Auth pages on wide screens: brand panel + form */
@media (min-width: 1024px) {
  html:has(body.page-auth.has-auth-aside), body.page-auth.has-auth-aside { height: auto !important; min-height: 100vh; overflow: visible !important; }
  body.page-auth.has-auth-aside { display: block !important; padding-left: 44vw; background: var(--c-bg) url('../images/pattern-desktop.svg') 75% -80px / 1100px auto no-repeat; }
  body.page-auth.has-auth-aside > .login-container { box-sizing: border-box; width: 100%; max-width: 520px; margin: 0 auto; padding: 56px 30px; min-height: 100vh !important; height: auto !important; overflow: visible !important; display: flex; flex-direction: column; justify-content: center; }
  body.page-auth.has-auth-aside > .login-container .logo { display: none; }
  body.page-auth.has-auth-aside .login-title { font-size: 34px; text-align: left; }
  body.page-auth.has-auth-aside .login-subtitle { text-align: left; margin-left: 0; max-width: none; font-size: 15px; }
  .auth-aside { position: fixed; left: 0; top: 0; bottom: 0; width: 44vw; overflow: hidden; border-radius: 0 40px 40px 0; z-index: 1; }
  .auth-aside__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .auth-aside__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(3,14,7,.55) 0%, rgba(3,14,7,.05) 35%, rgba(3,14,7,.9) 78%, #030e07 100%); }
  .auth-aside__logo { position: absolute; top: 40px; left: 48px; }
  .auth-aside__logo img { height: 28px; }
  .auth-aside__copy { position: absolute; left: 48px; right: 48px; bottom: 48px; color: #fff; font-family: var(--font-body); }
  .auth-aside__copy h2 { font: 500 44px/1.1 var(--font-display); margin: 0 0 14px; }
  .auth-aside__copy p { color: #c7cec9; font-size: 16px; line-height: 1.55; margin: 0 0 22px; max-width: 460px; }
  .auth-aside__copy ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
  .auth-aside__copy li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
  .auth-aside__copy li::before { content: "✓"; width: 24px; height: 24px; border-radius: 50%; background: var(--c-accent); color: var(--c-bg); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: 0 0 auto; }
  body.page-auth.has-auth-aside .role-toggle { margin-left: 0 !important; margin-right: 0 !important; max-width: none !important; width: 100% !important; }
  body.page-auth.has-auth-aside .login-subtitle br { display: none; }
  body.page-auth.has-auth-aside .cookie-bar { left: calc(44vw + 16px); }
}
@media (min-width: 1024px) and (max-height: 720px) { .auth-aside__copy h2 { font-size: 34px; } }

/* ==========================================================================
   Desktop page kit (dx-*): used by the redesigned athlete/coach pages.
   Only rendered inside .d-only blocks, so phones are untouched.
   ========================================================================== */
.dx { color: #fff; font-family: var(--font-body); }
.dx *, .dx *::before, .dx *::after { box-sizing: border-box; }
.dx a:not(.d-btn) { color: inherit; }
.dx-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 0 0 32px; }
.dx-eyebrow { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--c-accent); margin: 0 0 8px; font-weight: 600; }
.dx-title { font: 500 40px/1.12 var(--font-display); margin: 0; }
.dx-sub { color: #a9b3ab; margin: 8px 0 0; font-size: 15px; }
.dx-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.dx-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.dx-layout--wide-aside { grid-template-columns: minmax(0, 1fr) 380px; }
.dx-stack { display: grid; gap: 28px; align-content: start; min-width: 0; }
.dx-sticky { position: sticky; top: 28px; }
.dx-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.dx-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.dx-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1280px) {
  .dx-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; }
  .dx-grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dx-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.dx-panel { background: var(--c-card); border-radius: 22px; padding: 24px; }
.dx-panel--line { background: rgba(255,255,255,.03); border: 1px solid var(--c-line); }
.dx-panel--mint { background: var(--c-mint); color: #0b1f11; }
.dx-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 18px; }
.dx-panel__title { font: 500 20px/1.25 var(--font-display); margin: 0; }
.dx-link { color: var(--c-accent) !important; text-decoration: none; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.dx-link svg { width: 16px; height: 16px; }
.dx-link:hover { text-decoration: underline; }
.dx-section-title { font: 500 24px/1.2 var(--font-display); margin: 0; }
.dx-muted { color: #a9b3ab; }
.dx-small { font-size: 13px; }
.dx-tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 100px; background: rgba(255,255,255,.08); color: #e7ece8; font-size: 12px; font-weight: 500; white-space: nowrap; }
.dx-tag--accent { background: var(--c-accent); color: var(--c-bg); }
.dx-tag--more { background: transparent; border: 1px solid var(--c-line); }
.dx-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dx-icon { width: 20px; height: 20px; flex: 0 0 auto; }
.dx-empty { border: 1px dashed var(--c-line); border-radius: 22px; padding: 32px; text-align: center; color: #a9b3ab; }
.dx-empty strong { display: block; color: #fff; font: 500 18px var(--font-display); margin-bottom: 6px; }

/* Media card (workout with video poster) */
.dx-media { position: relative; display: block; border-radius: 22px; overflow: hidden; background: #0b1a10; text-decoration: none; color: #fff; isolation: isolate; }
.dx-media video, .dx-media img.dx-media__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.dx-media::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(3,14,7,0) 30%, rgba(3,14,7,.92) 100%); }
.dx-media__body { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px; }
.dx-media__title { font: 500 20px/1.2 var(--font-display); margin: 6px 0 4px; }
.dx-media__meta { font-size: 13px; color: #cfd6d1; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.dx-media__meta span { display: inline-flex; align-items: center; gap: 5px; }
.dx-media__meta svg { width: 14px; height: 14px; }
.dx-media__badge { position: absolute; top: 14px; left: 14px; }
.dx-media__done { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 50%; background: var(--c-accent); color: var(--c-bg); display: flex; align-items: center; justify-content: center; }
.dx-media__done svg { width: 18px; height: 18px; }
.dx-media--sm { aspect-ratio: 4 / 3; }
.dx-media--sm .dx-media__title { font-size: 16px; }
.dx-media--sm .dx-media__body { padding: 14px; }
.dx-media:hover { outline: 2px solid rgba(119,255,160,.6); outline-offset: -2px; }
.dx-play { width: 56px; height: 56px; border-radius: 50%; background: var(--c-accent); color: var(--c-bg); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.dx-play svg { width: 22px; height: 22px; margin-left: 3px; }

/* Hero: today's workout */
.dx-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); background: var(--c-card); border-radius: 26px; overflow: hidden; min-height: 320px; }
.dx-hero__media { position: relative; min-height: 320px; background: #0b1a10; }
.dx-hero__media video, .dx-hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dx-hero__media .dx-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.dx-hero__body { padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.dx-hero__title { font: 500 32px/1.15 var(--font-display); margin: 0; }
.dx-hero__coach { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #cfd6d1; text-decoration: none; }
.dx-hero__coach .d-avatar { width: 32px; height: 32px; font-size: 12px; }
.dx-hero__facts { display: flex; gap: 10px; flex-wrap: wrap; }
.dx-fact { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.07); border-radius: 100px; padding: 7px 12px; font-size: 13px; }
.dx-fact svg { width: 15px; height: 15px; color: var(--c-accent); }
.dx-hero__cta { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.dx-hero--rest { grid-template-columns: 1fr; min-height: 0; }

/* Progress */
.dx-streak { display: flex; align-items: center; gap: 16px; }
.dx-streak__num { font: 500 56px/1 var(--font-display); color: var(--c-accent); }
.dx-streak__label { font-size: 14px; color: #cfd6d1; line-height: 1.4; }
.dx-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 20px 0 0; }
.dx-week__day { text-align: center; font-size: 11px; color: #a9b3ab; }
.dx-week__dot { display: block; margin: 6px auto 0; width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.07); position: relative; }
.dx-week__dot.is-done { background: var(--c-accent); }
.dx-week__dot.is-done::after { content: "✓"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--c-bg); font-size: 13px; font-weight: 700; }
.dx-week__dot.is-today { box-shadow: 0 0 0 2px #fff inset; }
.dx-bar { height: 8px; border-radius: 8px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 8px; }
.dx-bar span { display: block; height: 100%; background: var(--c-accent); border-radius: 8px; }
.dx-kv { display: grid; gap: 0; margin: 0; }
.dx-kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--c-line); font-size: 14px; }
.dx-kv > div:last-child { border-bottom: 0; }
.dx-kv dt { color: #a9b3ab; }
.dx-kv dd { margin: 0; text-align: right; font-weight: 500; }

/* People rows / coach cards */
.dx-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--c-line); text-decoration: none; color: #fff; }
.dx-row:last-child { border-bottom: 0; }
.dx-row .d-avatar { width: 44px; height: 44px; font-size: 15px; flex: 0 0 auto; }
.dx-row__main { min-width: 0; flex: 1; }
.dx-row__title { font-weight: 600; font-size: 15px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx-row__sub { font-size: 12px; color: #a9b3ab; display: block; margin-top: 2px; }
a.dx-row:hover .dx-row__title { color: var(--c-accent); }
.dx-coach { background: var(--c-card); border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: #fff; border: 1px solid transparent; transition: border-color .15s, transform .15s; }
.dx-coach:hover { border-color: rgba(119,255,160,.5); transform: translateY(-2px); }
.dx-coach__img { aspect-ratio: 4 / 3; background: #0b1a10; position: relative; overflow: hidden; }
.dx-coach__img .d-avatar { background: radial-gradient(circle at 30% 20%, #1f5a33, #0b2414 70%); color: var(--c-accent); font: 500 56px var(--font-display); }
.dx-coach__img img, .dx-coach__img .d-avatar { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; font-size: 48px; display: flex; align-items: center; justify-content: center; }
.dx-coach__badge { position: absolute; top: 12px; left: 12px; }
.dx-coach__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.dx-coach__name { font: 500 19px/1.2 var(--font-display); margin: 0; }
.dx-coach__meta { font-size: 13px; color: #a9b3ab; display: flex; align-items: center; gap: 6px; }
.dx-coach__meta svg { width: 14px; height: 14px; }
.dx-coach__bio { font-size: 13px; color: #cfd6d1; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.dx-coach__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 6px; color: var(--c-accent); font-size: 14px; font-weight: 600; }
.dx-coach__foot svg { width: 18px; height: 18px; }

/* Toolbar: search + chips */
.dx-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 24px; }
.dx-search { display: flex; align-items: center; gap: 10px; background: var(--c-input); border-radius: 100px; padding: 0 16px; height: 44px; min-width: 380px; }
.dx-search svg { width: 18px; height: 18px; color: #cfd6d1; }
.dx-search input { background: transparent; border: 0; outline: 0; color: #fff; font: 14px var(--font-body); flex: 1; min-width: 0; }
.dx-search input::placeholder { color: #bdbdbd; }
.dx-search:focus-within { box-shadow: 0 0 0 2px rgba(119,255,160,.6); }
.dx-chip { height: 36px; padding: 0 14px; border-radius: 100px; border: 1px solid var(--c-line); background: transparent; color: #fff; font: 500 13px var(--font-body); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.dx-chip:hover { border-color: rgba(119,255,160,.6); }
.dx-chip.is-on { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-bg); }
.dx-chip .dx-count { opacity: .7; font-weight: 400; }
.dx-select { height: 36px; border-radius: 100px; border: 1px solid var(--c-line); background: transparent; color: #fff; font: 500 13px var(--font-body); padding: 0 12px; color-scheme: dark; }

/* Profile header card */
.dx-profile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px; align-items: center; background: linear-gradient(135deg, #12391f 0%, #0b2414 60%, #071a0d 100%); border-radius: 26px; padding: 32px; position: relative; overflow: hidden; }
.dx-profile::after { content: ""; position: absolute; inset: 0; background: url('../images/pattern-desktop.svg') right -120px top -200px / 900px auto no-repeat; opacity: .5; pointer-events: none; }
.dx-profile > * { position: relative; z-index: 1; }
.dx-profile__avatar { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255,255,255,.85); font-size: 36px; display: flex; align-items: center; justify-content: center; }
.dx-profile__name { font: 500 34px/1.1 var(--font-display); margin: 0 0 6px; }
.dx-profile__meta { display: flex; gap: 16px; flex-wrap: wrap; color: #cfd6d1; font-size: 14px; }
.dx-profile__meta span { display: inline-flex; align-items: center; gap: 6px; }
.dx-profile__meta svg { width: 16px; height: 16px; color: var(--c-accent); }

/* Settings list */
.dx-menu { display: grid; }
.dx-menu a, .dx-menu button { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border: 0; border-bottom: 1px solid var(--c-line); background: none; color: #fff; text-decoration: none; font: 500 15px var(--font-body); cursor: pointer; text-align: left; width: 100%; }
.dx-menu > :last-child { border-bottom: 0; }
.dx-menu svg { width: 20px; height: 20px; color: var(--c-accent); }
.dx-menu a:hover, .dx-menu button:hover { color: var(--c-accent); }
.dx-menu .dx-menu__arrow { margin-left: auto; color: #a9b3ab; }
.dx-menu .is-danger, .dx-menu .is-danger svg { color: #ff9b9b; }

/* Redesigned desktop pages scroll the whole window (the phone layouts lock it). */
@media (min-width: 1024px) {
  html:has(body.dx-body), body.dx-body { height: auto !important; min-height: 100vh; overflow: visible !important; }
  body.dx-body { background: var(--c-bg) !important; }
}
@media (min-width: 1024px) {
  .page-workout .date-box .date-dot { display: block !important; width: 6px; height: 6px; border-radius: 50%; background: transparent; opacity: 1 !important; }
  .page-workout .date-box.has-workout .date-dot { background: var(--c-accent) !important; }
  .page-workout .date-box.selected .date-dot { background: var(--c-bg) !important; }
}
.dx-stat { background: rgba(255,255,255,.05); border-radius: 16px; padding: 16px; }
.dx-stat strong { display: block; font: 500 34px/1 var(--font-display); color: var(--c-accent); }
.dx-stat span { display: block; margin-top: 8px; font-size: 13px; color: #cfd6d1; }
.dx-table td, .dx-table th { padding-left: 0; }
.dx-sub { padding: 6px 0 10px; border-bottom: 1px solid var(--c-line); }
.dx-sub:last-child { border-bottom: 0; padding-bottom: 0; }
.dx-sub .dx-kv > div { padding: 8px 0; font-size: 13px; }
.dx-avatar-edit { position: absolute; right: 2px; bottom: 2px; width: 34px; height: 34px; border-radius: 50%; background: var(--c-accent); color: var(--c-bg); display: flex; align-items: center; justify-content: center; border: 3px solid #0b2414; }
.dx-avatar-edit svg { width: 16px; height: 16px; }
.dx-settings .acct { margin: 0; }
.dx-settings .acct__title { font: 500 20px var(--font-display); margin-bottom: 16px; }
.dx-settings .acct__row { background: rgba(255,255,255,.05); }
.dx a.dx-row, .dx a.dx-coach, .dx a.dx-media, .dx button.dx-media { color: #fff; }
@media (min-width: 1024px) {
  .page-trainer-profile .subscription-container { display: none !important; }
  body.page-trainer-profile:not(.has-app-shell) .d-page { max-width: 1240px; }
}
.dx-profile--coach { grid-template-columns: auto minmax(0, 1fr); }
.dx-profile--coach > div:empty { display: none; }
.dx-price { display: flex; flex-direction: column; background: linear-gradient(160deg, #164a28 0%, #0f2e18 70%); border: 1px solid rgba(119,255,160,.25); }
.dx-price__amount { font: 500 44px/1.1 var(--font-display); margin: 6px 0 16px; }
.dx-price__amount small { font-size: 16px; color: #a9b3ab; font-family: var(--font-body); }
.dx-checks { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.dx-checks li { display: flex; gap: 10px; align-items: center; }
.dx-checks li::before { content: "✓"; width: 22px; height: 22px; border-radius: 50%; background: rgba(119,255,160,.15); color: var(--c-accent); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.dx-textbtn { background: none; border: 0; color: #ff9b9b; font: 500 14px var(--font-body); margin-top: 14px; cursor: pointer; text-decoration: underline; }
.dx-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; counter-reset: step; }
.dx-steps li { display: flex; align-items: center; gap: 12px; font-size: 14px; counter-increment: step; }
.dx-steps li::before { content: counter(step); width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.08); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: 0 0 auto; }
.dx-steps li span { margin-left: auto; color: #a9b3ab; font-size: 12px; }
.dx [hidden] { display: none !important; }
.dx-subcard { display: grid; grid-template-columns: minmax(260px, 1.2fr) minmax(0, 1.6fr) auto; gap: 28px; align-items: center; background: var(--c-card); border-radius: 22px; padding: 22px 26px; }
.dx-subcard__who { display: flex; gap: 16px; align-items: center; text-decoration: none; }
.dx-subcard__avatar { width: 72px !important; height: 72px !important; border-radius: 50%; object-fit: cover; font-size: 24px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.dx-subcard__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; }
.dx-subcard__facts dt { font-size: 12px; color: #a9b3ab; margin-bottom: 6px; }
.dx-subcard__facts dd { margin: 0; font: 500 16px var(--font-display); }
.dx-subcard__facts dd small { display: block; font: 12px var(--font-body); color: #a9b3ab; margin-top: 2px; }
@media (max-width: 1280px) { .dx-subcard { grid-template-columns: 1fr 1.4fr; } .dx-subcard > .dx-actions { grid-column: 1 / -1; } }
.dx-metric-btn { border: 1px solid transparent; color: #fff; text-align: left; cursor: pointer; font: inherit; }
.dx-metric-btn:hover { border-color: rgba(119,255,160,.5); }
.dx-dots { display: inline-flex; gap: 4px; }
.dx-dots i { width: 10px; height: 10px; border-radius: 3px; background: rgba(255,255,255,.12); }
.dx-dots i.on { background: var(--c-accent); }
.dx-tile { display: flex; flex-direction: column; gap: 6px; background: var(--c-card); border-radius: 20px; padding: 20px; text-decoration: none; border: 1px solid transparent; }
.dx-tile:hover { border-color: rgba(119,255,160,.5); }
.dx-tile strong { font: 500 18px var(--font-display); color: #fff; margin-top: 8px; }
.dx-tile span:last-child { font-size: 13px; color: #a9b3ab; }
.dx-tile__ic { width: 44px; height: 44px; border-radius: 12px; background: var(--c-accent); color: var(--c-bg); display: flex; align-items: center; justify-content: center; }
.dx-tile__ic svg { width: 22px; height: 22px; }
.dx a.dx-tile { color: #fff; }
.dx .cl { margin: 0; }
.dx-tile--big { padding: 26px; flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 16px; }
.dx-tile--big strong { margin: 0; font-size: 20px; }
.dx-tile--big span:last-child { flex-basis: 100%; margin-top: 8px; font-size: 14px; }
.dx-faq details { border-bottom: 1px solid var(--c-line); }
.dx-faq details:last-child { border-bottom: 0; }
.dx-faq summary { cursor: pointer; list-style: none; padding: 18px 0; font: 500 16px var(--font-display); display: flex; justify-content: space-between; gap: 16px; }
.dx-faq summary::-webkit-details-marker { display: none; }
.dx-faq summary::after { content: "+"; color: var(--c-accent); font-size: 22px; line-height: 1; }
.dx-faq details[open] summary::after { content: "–"; }
.dx-faq p { margin: 0 0 18px; color: #cfd6d1; line-height: 1.6; font-size: 14px; }

/* Narrow desktops / small laptops (1024–1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
  .dx-layout, .dx-layout--wide-aside { grid-template-columns: minmax(0, 1fr); }
  .dx-layout > aside.dx-stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
  .dx-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dx-grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .dx-profile { grid-template-columns: auto minmax(0, 1fr); }
  .dx-profile > .dx-actions { grid-column: 1 / -1; }
  .dx-head { flex-wrap: wrap; }
  .dx-search { min-width: 260px; }
  .dx-hide-narrow { display: none !important; }
  .dx-subcard__facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.dx .d-table { width: 100%; }

/* Edit-profile form opens as a side drawer on desktop (same as the client drawer) */
@media (min-width: 1024px) {
  body.page-profile #editProfileModal { left: 0 !important; background: rgba(3,14,7,.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
  body.page-profile #editProfileModal .modal-content { width: 631px; max-width: 100vw; left: auto; right: 0; background: var(--c-drawer); border-left: 2px solid #fff; border-radius: 0; }
  body.page-profile #editProfileModal .modal-header { padding: 32px 40px 16px; }
  body.page-profile #editProfileModal .modal-body { padding: 8px 40px 40px; }
}
body.page-profile #editProfileModal textarea { font-family: var(--font-body); }

/* Planner: list of workouts under the calendar */
.pl-list { margin-top: 44px; }
.pl-tabs { display: flex; gap: 8px; }
.pl-table td { vertical-align: middle; }
.pl-table tbody tr { cursor: pointer; }
.pl-table tbody tr:hover { background: rgba(255,255,255,.03); }
.pl-sub { display: block; font-size: 12px; color: var(--c-muted); margin-top: 2px; }
.pl-btn { padding: 7px 14px !important; font-size: 13px !important; display: inline-flex; align-items: center; gap: 6px; }
.pl-btn svg { width: 15px; height: 15px; }
.pl-table .d-actions { white-space: nowrap; text-align: right; }

/* Exercise tiles (workout editor + library): still images, preview on demand */
.video-card img.video-thumb { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; background: #101a13; }
.video-card { contain: layout paint; }
.video-card .vc-preview { position: absolute; left: 8px; top: 8px; z-index: 3; width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0; background: rgba(3,14,7,.72); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.video-card .vc-preview svg { width: 14px; height: 14px; margin-left: 2px; }
.video-card .vc-preview:hover { background: #77ffa0; color: #030e07; }
.video-thumbnail img:not(.play-overlay) { display: block; width: 100%; height: 100%; object-fit: cover; background: #101a13; }
.vt-modal { position: fixed; inset: 0; z-index: 10050; background: rgba(0,0,0,.82); display: none; align-items: center; justify-content: center; padding: 16px; }
.vt-modal.is-open { display: flex; }
.vt-modal__box { position: relative; max-width: min(92vw, 720px); }
.vt-modal__video { display: block; max-width: 100%; max-height: 86vh; border-radius: 18px; background: #000; }
.vt-modal__close { position: absolute; top: -14px; right: -14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #fff; color: #030e07; font: 600 22px/36px sans-serif; cursor: pointer; }
/* The clip preview must open above the exercise library panel (z 99999). */
.page-planner #video-preview-modal, .page-library #video-preview-modal { z-index: 100100 !important; }

/* ---------- Custom scrollbars (every page, every scrolling box) ----------
   Thin green thumb on an invisible track; grows a little on hover. Works on the dark app
   background and on the light cards. Rows that hide their scrollbar on purpose
   (scrollbar-width: none / ::-webkit-scrollbar { display: none }) keep it hidden. */
:root {
  --sb-thumb: rgba(92, 196, 128, .55);
  --sb-thumb-hover: rgba(119, 255, 160, .9);
}
::-webkit-scrollbar { width: 10px; height: 10px; background: transparent; }
::-webkit-scrollbar-track { background: transparent; margin: 14px; } /* clear of rounded corners */
html::-webkit-scrollbar-track, body::-webkit-scrollbar-track { margin: 0; }
::-webkit-scrollbar-thumb {
  background: var(--sb-thumb);
  border-radius: 999px;
  border: 3px solid transparent;          /* inset: the visible bar is 4px */
  background-clip: padding-box;
  min-height: 40px;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--sb-thumb-hover); border-width: 2px; }
::-webkit-scrollbar-thumb:active { background-color: #77FFA0; border-width: 2px; }
::-webkit-scrollbar-corner,
::-webkit-scrollbar-button { display: none; background: transparent; width: 0; height: 0; }
/* Firefox (no ::-webkit-scrollbar) */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) transparent; }
}
/* Boxes inside the page get an overlay scrollbar (assets/js/scrollbars.js) instead of a native
   one, so the bar no longer takes width and full-bleed content reaches the edge.
   Only when that script runs (html.ovs-on); the page's own scrollbar stays as above. */
html.ovs-on body * { scrollbar-width: none; }
html.ovs-on body *::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none; }
.ovs-bar { position: fixed; z-index: 2147483000; opacity: 0; pointer-events: none; transition: opacity .25s ease; touch-action: none; }
.ovs-bar.is-on { opacity: 1; pointer-events: auto; }
.ovs-bar i { position: absolute; display: block; border-radius: 999px; background: var(--sb-thumb);
  box-shadow: 0 0 0 1px rgba(3,14,7,.25); transition: width .15s, height .15s, background-color .15s; cursor: default; }
.ovs-y { width: 12px; }
.ovs-y i { top: 0; right: 3px; width: 4px; }
.ovs-x { height: 12px; }
.ovs-x i { left: 0; bottom: 3px; height: 4px; }
.ovs-y:hover i, .ovs-y.is-drag i { width: 7px; background-color: var(--sb-thumb-hover); }
.ovs-x:hover i, .ovs-x.is-drag i { height: 7px; background-color: var(--sb-thumb-hover); }
.ovs-bar.is-drag i { background-color: #77FFA0; }
@media print { .ovs-bar { display: none !important; } }
