/* Dashboard — Add Story / Clips modal */

button.story.story-add-trigger {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.story-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: stretch;
  animation: storyModalIn 0.28s ease;
}

.story-modal[hidden] {
  display: none !important;
}

@keyframes storyModalIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.story-modal-backdrop {
  position: absolute;
  inset: 0;
  background: #000;
}

.story-modal-ambient {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.story-modal-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.22;
}

.story-modal-orb--pink {
  width: 420px;
  height: 420px;
  top: 18%;
  left: 8%;
  background: var(--accent-2);
}

.story-modal-orb--cyan {
  width: 380px;
  height: 380px;
  bottom: 12%;
  right: 10%;
  background: var(--accent);
}

.story-modal-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-height: 100vh;
  padding: 22px clamp(20px, 4vw, 48px) 32px;
  color: #fff;
}

/* Header */
.story-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.story-modal-header-leading {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.story-modal-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.story-header-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.story-header-tab {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  font-size: 1rem;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.story-header-tab:not(.is-active) {
  background: transparent;
}

.story-header-tab--muted {
  color: rgba(255, 255, 255, 0.42);
  font-weight: 500;
}

.story-header-tab.is-active {
  background: var(--accent);
  color: #fff;
}

.story-header-tab--muted.is-active {
  color: #fff;
  font-weight: 600;
}

.story-header-tabs--merch .story-header-tab {
  padding: 4px 0;
  margin-right: 18px;
  border-radius: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  background: transparent;
}

.story-header-tabs--merch .story-header-tab--muted {
  color: rgba(255, 255, 255, 0.38);
  font-weight: 500;
}

.story-header-tabs--merch .story-header-tab.is-active {
  background: transparent;
  color: #fff;
}

.story-header-tabs--merch .story-header-tab--muted.is-active {
  color: rgba(255, 255, 255, 0.38);
}

.story-modal-close {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #0a0a0a;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1.05rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.story-modal-close:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Panels */
.story-modal-panel {
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
}

.story-modal-panel.is-active {
  display: flex;
  animation: storyPanelIn 0.22s ease;
}

@keyframes storyPanelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.story-modal-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 24px 0;
}

.story-modal-stage--scroll {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}

.story-modal-tab-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 6px 0 16px;
  flex-shrink: 0;
}

/* Create Clips */
.story-create-grid {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(28px, 5vw, 56px);
  flex-wrap: wrap;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}

.story-create-card {
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 0;
  color: #fff;
  transition: transform 0.22s ease;
}

.story-create-card:hover {
  transform: translateY(-4px);
}

.story-create-card:active {
  transform: translateY(-1px);
}

.story-create-card-inner {
  width: clamp(168px, 16vw, 210px);
  height: clamp(168px, 16vw, 210px);
  border-radius: 24px;
  background: linear-gradient(145deg, #de4e90 0%, #c256a4 38%, #5ec4f2 100%);
  display: grid;
  place-items: center;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: box-shadow 0.22s ease;
}

.story-create-card:hover .story-create-card-inner {
  box-shadow:
    0 28px 70px rgba(222, 78, 144, 0.22),
    0 24px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.story-create-card-inner svg {
  width: clamp(52px, 5vw, 64px);
  height: clamp(52px, 5vw, 64px);
  color: rgba(255, 255, 255, 0.95);
}

.story-create-label {
  font-size: 1.08rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.92);
}

/* Your Clips tray */
.story-clips-tray {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3.5vw, 36px);
  flex-wrap: wrap;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.story-clip-item {
  position: relative;
  width: clamp(168px, 18vw, 220px);
  height: clamp(168px, 18vw, 220px);
  border-radius: 22px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.story-clip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-clip-item.is-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.story-clip-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.story-clip-play span {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  display: grid;
  place-items: center;
  color: #1a1a1a;
  font-size: 1.15rem;
  padding-left: 3px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.story-clip-add {
  border: 0;
  cursor: pointer;
  width: clamp(168px, 18vw, 220px);
  height: clamp(168px, 18vw, 220px);
  border-radius: 22px;
  background: linear-gradient(155deg, #de4e90 0%, #c256a4 42%, #5ec4f2 100%);
  display: grid;
  place-items: center;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  flex-shrink: 0;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.38);
}

.story-clip-add:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 56px rgba(222, 78, 144, 0.2);
}

.story-clip-add span {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.55rem;
  backdrop-filter: blur(4px);
}

/* Picker */
.story-modal-panel[data-story-panel="picker"] .story-modal-stage--scroll,
.story-modal-panel[data-story-panel="merch"] .story-modal-stage--scroll {
  padding-top: 4px;
}

.story-picker-body,
.story-merch-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 10px;
  width: 100%;
  margin: 0 auto;
}

.story-picker-body::-webkit-scrollbar,
.story-merch-body::-webkit-scrollbar {
  width: 4px;
}

.story-picker-body::-webkit-scrollbar-track,
.story-merch-body::-webkit-scrollbar-track {
  background: transparent;
}

.story-picker-body::-webkit-scrollbar-thumb,
.story-merch-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}

.story-picker-grid {
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.story-picker-grid.is-active {
  display: grid;
}

.story-picker-item {
  position: relative;
  aspect-ratio: 1;
  border: 3px solid transparent;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.story-picker-item:hover {
  transform: scale(1.015);
}

.story-picker-item.is-selected {
  border-color: var(--accent);
}

.story-picker-media {
  position: absolute;
  inset: 0;
  display: block;
  background: rgba(255, 255, 255, 0.04);
}

.story-picker-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #0d1018;
}

.story-picker-check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  background: rgba(18, 18, 22, 0.55);
  z-index: 3;
  pointer-events: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.story-picker-item.is-selected .story-picker-check {
  background: var(--accent);
  border-color: var(--accent);
}

.story-picker-item.is-selected .story-picker-check::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 999px;
  background: #fff;
}

.story-picker-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 2;
}

.story-picker-play span {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  display: grid;
  place-items: center;
  color: #1a1a1a;
  font-size: 0.9rem;
  padding-left: 2px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

/* Merch */
.story-merch-search-wrap {
  position: relative;
  margin: 4px 0 18px;
  flex-shrink: 0;
  width: 100%;
}

.story-merch-search {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 14px 50px 14px 22px;
  font-size: 0.98rem;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.story-merch-search:focus {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: rgba(255, 255, 255, 0.09);
}

.story-merch-search::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.story-merch-search-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.65);
  pointer-events: none;
  font-size: 1rem;
}

.story-merch-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.story-merch-card {
  position: relative;
  border: 2px solid transparent;
  text-align: center;
  cursor: pointer;
  background: #fff;
  color: #111;
  border-radius: 6px;
  padding: 10px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  min-height: 100%;
}

.story-merch-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.story-merch-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.35);
}

.story-merch-check {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 0;
  background: rgba(170, 170, 170, 0.9);
  z-index: 2;
  pointer-events: none;
  transition: background 0.15s ease;
}

.story-merch-card.is-selected .story-merch-check {
  background: var(--accent);
}

.story-merch-card.is-selected .story-merch-check::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 999px;
  background: #fff;
}

.story-merch-thumb-wrap {
  display: grid;
  place-items: center;
  min-height: 110px;
  padding: 2px 0 4px;
}

.story-merch-thumb {
  width: 100%;
  max-height: 120px;
  object-fit: contain;
  display: block;
}

.story-merch-name {
  font-weight: 800;
  font-size: 0.8rem;
  line-height: 1.3;
  margin: 0;
  color: #111;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-merch-price {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
  color: #111;
}

/* Footer actions */
.story-modal-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  padding: 20px 0 8px;
  margin-top: auto;
}

.story-modal-actions--single .story-btn-post {
  min-width: 130px;
  padding: 13px 36px;
}

.story-btn {
  border: 0;
  border-radius: 6px;
  padding: 13px 32px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.story-btn:hover {
  transform: translateY(-1px);
}

.story-btn-save {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 28px rgba(var(--accent-rgb), 0.28);
}

.story-btn-discard {
  background: var(--accent-2);
  color: #fff;
  box-shadow: 0 10px 28px rgba(var(--accent-2-rgb), 0.24);
}

.story-btn-post {
  background: var(--accent);
  color: #fff;
  text-transform: uppercase;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 28px rgba(var(--accent-rgb), 0.3);
}

/* Ghost actions on Create Clips */
.story-modal-actions--ghost .story-btn {
  padding: 10px 26px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: none;
  opacity: 0.72;
}

.story-modal-actions--ghost .story-btn-save {
  background: rgba(58, 88, 118, 0.75);
}

.story-modal-actions--ghost .story-btn-discard {
  background: rgba(108, 52, 78, 0.75);
}

.story-modal-actions--ghost .story-btn:hover {
  opacity: 0.95;
  transform: none;
}

body.story-modal-open {
  overflow: hidden;
}

.story-avatar.has-story {
  background-size: cover !important;
}

.story-avatar.has-story #storyYouPlus,
.story-avatar.has-story .bi-plus-lg {
  display: none;
}

@media (max-width: 1199.98px) {
  .story-merch-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .story-picker-grid,
  .story-merch-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .story-modal-shell {
    padding: 18px 16px 24px;
  }

  .story-picker-grid,
  .story-merch-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .story-create-grid {
    gap: 24px;
  }

  .story-header-tab {
    padding: 7px 14px;
    font-size: 0.95rem;
  }
}

@media (max-width: 575.98px) {
  .story-picker-grid,
  .story-merch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-modal-actions--dual {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
  }

  .story-btn {
    width: 100%;
  }

  .story-modal-actions--ghost {
    max-width: 240px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-modal,
  .story-modal-panel.is-active {
    animation: none;
  }
}



.story-video-modal-stage--scroll{

    flex: 1;
    display: flex;
    align-items: center;
    /* justify-content: center; */
    min-height: 0;
    padding: 24px 0;

}