/* ——— OTC Pro workspace — tabs, app carousel, home-screen icons ——— */

/* Workspace: tabs + paged app carousel */
.otc-ws {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2vw, 22px);
  min-height: 0;
}

.otc-ws__tabs {
  display: flex;
  gap: 6px;
  align-self: center;
  max-width: 100%;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 255, 0.18);
  background: rgba(7, 11, 26, 0.55);
  overflow-x: auto;
  scrollbar-width: none;
}

.otc-ws__tabs::-webkit-scrollbar { display: none; }

.otc-ws__tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #c7d2fe;
  font: 700 14px/1 "Plus Jakarta Sans", Segoe UI, Arial, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.otc-ws__tab:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

.otc-ws__tab[aria-selected="true"] {
  color: #fff;
  background: linear-gradient(135deg, #5b4bff 0%, #4338ca 100%);
  box-shadow: 0 6px 18px rgba(91, 75, 255, 0.4);
}

.otc-ws__tab:focus-visible { outline: 3px solid #22d3ee; outline-offset: 2px; }

.otc-ws__tab-count {
  min-width: 20px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 11px;
  text-align: center;
}

.otc-ws__stage {
  flex: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(4px, 1.5vw, 18px);
}

.otc-ws__viewport {
  --ws-cols: 4;
  --ws-rows: 2;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.otc-ws__viewport::-webkit-scrollbar { display: none; }

@media (min-width: 720px) {
  .otc-ws__viewport { --ws-cols: 5; }
}

.otc-ws__track { display: flex; }

/* Flex-wrap (not grid) so part-filled pages centre their icons */
.otc-ws__page {
  --ws-gap-x: clamp(6px, 1.6vw, 20px);
  flex: 0 0 100%;
  scroll-snap-align: start;
  list-style: none;
  margin: 0;
  padding: 10px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: clamp(18px, 2.8vw, 34px) var(--ws-gap-x);
}

.otc-ws-app {
  width: calc((100% - (var(--ws-cols) - 1) * var(--ws-gap-x)) / var(--ws-cols));
  min-width: 0;
}

.otc-ws__arrow {
  display: grid;
  place-items: center;
  width: clamp(36px, 3.4vw, 48px);
  height: clamp(36px, 3.4vw, 48px);
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.otc-ws__arrow:hover:not(:disabled) { background: rgba(91, 75, 255, 0.45); transform: scale(1.06); }
.otc-ws__arrow:focus-visible { outline: 3px solid #22d3ee; outline-offset: 2px; }
.otc-ws__arrow:disabled { opacity: 0.25; cursor: default; }

.otc-ws__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-height: 8px;
}

.otc-ws__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(199, 210, 254, 0.35);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.otc-ws__dot[aria-current="true"] { width: 24px; background: #22d3ee; }

/* App icons (phone home screen style) */
.otc-ws-app__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 6px 2px;
  border-radius: 18px;
  color: #fff;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.otc-ws__track.is-entering .otc-ws-app {
  animation: otc-ws-pop 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
  animation-delay: calc(var(--i, 0) * 22ms);
}

@keyframes otc-ws-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.92); }
  to { opacity: 1; transform: none; }
}

.otc-ws-app__icon {
  display: grid;
  place-items: center;
  width: clamp(62px, 7.6vw, 108px);
  aspect-ratio: 1;
  border-radius: 23%;
  overflow: hidden;
  background: #fff;
  font-size: clamp(28px, 3.4vw, 46px);
  box-shadow: 0 10px 24px rgba(3, 6, 20, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.2s ease;
}

.otc-ws-app__icon img { width: 100%; height: 100%; object-fit: cover; }

/* Pro-only apps on the Member dashboard: dimmed icon with a lock badge */
.otc-ws-app--locked .otc-ws-app__icon { position: relative; }
.otc-ws-app--locked .otc-ws-app__icon > img,
.otc-ws-app--locked .otc-ws-app__icon--emoji { filter: saturate(0.55) brightness(0.82); }
.otc-ws-app--locked .otc-ws-app__label { color: #b8c2e8; }

.otc-ws-app__lock {
  position: absolute;
  right: 6%;
  bottom: 6%;
  display: grid;
  place-items: center;
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(10, 15, 36, 0.86);
  box-shadow: 0 0 0 2px rgba(103, 232, 249, 0.55);
  font-size: clamp(11px, 1.3vw, 17px);
}

/* Corner tag on an app icon (app.badge), e.g. "NEW" */
.otc-ws-app__art { position: relative; display: block; }

.otc-ws-app__badge {
  position: absolute;
  top: -7px;
  right: -12px;
  z-index: 1;
  overflow: hidden;
  padding: 4px 8px;
  border-radius: 999px;
  background: linear-gradient(120deg, #22d3ee, #8b5cf6 55%, #ec4899);
  box-shadow: 0 0 0 2px #0a0f24, 0 6px 16px rgba(236, 72, 153, 0.5), 0 0 18px rgba(34, 211, 238, 0.45);
  color: #fff;
  font: 800 clamp(9.5px, 0.8vw, 11px)/1 "Plus Jakarta Sans", system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 2px rgba(30, 10, 60, 0.45);
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.otc-ws-app__badge::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.75) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: otc-ws-badge-shine 3.2s ease-in-out infinite;
}

@keyframes otc-ws-badge-shine {
  0%, 55% { transform: translateX(-120%); }
  85%, 100% { transform: translateX(120%); }
}

.otc-ws-app__link:hover .otc-ws-app__badge { transform: translateY(-4px) rotate(4deg) scale(1.06); }

.otc-ws-app__label {
  max-width: 100%;
  color: #e8edff;
  font-size: clamp(12.5px, 1.05vw, 15px);
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-shadow: 0 1px 6px rgba(3, 6, 20, 0.6);
}

.otc-ws-app__link:hover .otc-ws-app__icon {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 16px 32px rgba(3, 6, 20, 0.55), 0 0 26px rgba(34, 211, 238, 0.35);
}

.otc-ws-app__link:active .otc-ws-app__icon { transform: scale(0.94); }
.otc-ws-app__link:focus-visible { outline: none; }
.otc-ws-app__link:focus-visible .otc-ws-app__icon { outline: 3px solid #22d3ee; outline-offset: 3px; }

/* Phones: tabs in a 2×2 grid; arrows sit under the icons, either side of the page dots */
@media (max-width: 559px) {
  .otc-ws__tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-self: stretch;
    border-radius: 20px;
  }
  .otc-ws__tab { justify-content: center; padding: 10px 8px; font-size: 13px; border-radius: 15px; }
  .otc-ws__tab:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .otc-ws__stage {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "view view" "prev next";
    row-gap: 6px;
  }
  .otc-ws__viewport { grid-area: view; }
  .otc-ws__arrow { width: 38px; height: 38px; }
  .otc-ws__arrow--prev { grid-area: prev; justify-self: start; }
  .otc-ws__arrow--next { grid-area: next; justify-self: end; }
  .otc-ws__dots {
    height: 38px;
    align-items: center;
    margin-top: calc(-38px - clamp(14px, 2vw, 22px));
    pointer-events: none;
  }
  .otc-ws__dot { pointer-events: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .otc-ws-app__icon,
  .otc-ws-app__link:hover .otc-ws-app__icon,
  .otc-ws-app__link:active .otc-ws-app__icon { transition: none; transform: none; }
  .otc-ws__track.is-entering .otc-ws-app { animation: none; }
  .otc-ws__viewport { scroll-behavior: auto; }
  .otc-ws-app__badge,
  .otc-ws-app__link:hover .otc-ws-app__badge { transition: none; transform: none; }
  .otc-ws-app__badge::after { animation: none; }
}
