.shared-scene-page {
  width: min(1480px, calc(100% - 40px));
  padding-bottom: 120px;
}

.shared-scene-topbar {
  max-width: none;
}

.shared-scene-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 20px;
}

.shared-scene-main {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #100f13;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.shared-scene-header {
  position: relative;
  padding: 26px 30px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(90deg, rgba(219, 55, 119, 0.1), transparent 54%),
    #131116;
}

.shared-scene-header h1 {
  max-width: 820px;
  margin-top: 18px;
  font-size: 46px;
  line-height: 1.04;
}

.shared-scene-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.shared-scene-primary-actions .button-primary {
  min-height: 44px;
  padding-inline: 20px;
}

.shared-scene-warning,
.shared-earlier,
.shared-transcript,
.shared-scene-continue,
.shared-derived-media {
  margin-right: 30px;
  margin-left: 30px;
}

.shared-scene-warning {
  margin-top: 20px;
}

.shared-earlier {
  border-color: rgba(255, 255, 255, 0.08);
  background: #17151a;
}

.shared-transcript {
  position: relative;
  gap: 30px;
  margin-top: 28px;
  padding: 8px 0 20px;
}

.shared-transcript::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 44px;
  left: 15px;
  width: 1px;
  background: linear-gradient(rgba(219, 55, 119, 0.35), rgba(97, 202, 211, 0.12));
}

.shared-message {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.shared-message-label {
  margin-bottom: 9px;
}

.shared-message-bubble {
  width: min(76%, 760px);
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: #1b181e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.68;
}

.shared-message-user {
  align-items: flex-end;
}

.shared-message-user .shared-message-label {
  justify-content: flex-end;
}

.shared-message-user .shared-message-bubble {
  border-color: rgba(97, 202, 211, 0.18);
  background: #122024;
}

.shared-message-ai .shared-message-bubble {
  border-left: 2px solid rgba(219, 55, 119, 0.72);
}

.shared-scene-continue {
  margin-top: 16px;
  border-color: rgba(219, 55, 119, 0.22);
  background: linear-gradient(100deg, rgba(219, 55, 119, 0.12), rgba(97, 202, 211, 0.05));
}

.shared-scene-aside {
  position: sticky;
  top: calc(var(--header-height) + 14px);
  display: grid;
  gap: 12px;
}

.shared-comments {
  display: flex;
  max-height: calc(100vh - var(--header-height) - 34px);
  min-height: 520px;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(19, 17, 22, 0.96);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
}

.shared-comments-sticky-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.shared-comments-sticky-head h2,
.shared-comments-sticky-head p {
  margin: 0;
}

.shared-comments-sticky-head h2 {
  margin-top: 4px;
  font-size: 18px;
}

.shared-comments .comment-composer {
  grid-template-columns: 28px minmax(0, 1fr);
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: #161419;
}

.shared-comments .comment-composer .button {
  grid-column: 2;
  justify-self: end;
}

.shared-comments .comment-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.shared-comments .comment-item {
  padding: 14px;
}

.shared-comments .comment-content p {
  font-size: 11px;
  line-height: 1.55;
}

.shared-comments .comments-more {
  width: calc(100% - 28px);
  margin: 10px 14px 14px;
}

.shared-context-card,
.shared-creator-card,
.shared-aside-note {
  background: #141217;
}

.shared-derived-media {
  margin-top: 44px;
  margin-bottom: 34px;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.shared-media-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.shared-media-heading h2,
.shared-media-heading p {
  margin: 0;
}

.shared-media-heading h2 {
  margin-top: 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
}

.shared-media-heading > div:first-child > p:last-child {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.shared-media-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: #151318;
}

.shared-media-tabs button {
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.shared-media-tabs button:hover,
.shared-media-tabs button.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.shared-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shared-media-card {
  position: relative;
  min-height: 250px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: #17151a;
}

.shared-media-card[hidden] {
  display: none;
}

.shared-media-visual img,
.shared-media-visual video {
  width: 100%;
  height: 250px;
  display: block;
  object-fit: cover;
}

.shared-media-visual::after {
  content: "";
  position: absolute;
  inset: 42% 0 0;
  background: linear-gradient(transparent, rgba(9, 8, 11, 0.94));
  pointer-events: none;
}

.shared-media-visual > div {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  z-index: 2;
}

.shared-media-card h3,
.shared-media-card p {
  margin: 0;
}

.shared-media-card h3 {
  font-size: 15px;
}

.shared-media-card p {
  margin-top: 4px;
  color: #c4bec8;
  font-size: 10px;
}

.shared-media-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 4px;
  background: rgba(8, 8, 10, 0.72);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.shared-video-player {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(10, 9, 12, 0.62);
  color: #fff;
  cursor: pointer;
}

.shared-media-audio {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(97, 202, 211, 0.13), transparent 55%),
    #151a1c;
}

.shared-media-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #95e2e8;
  font-size: 9px;
  font-weight: 800;
}

.shared-media-card-top span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.shared-media-card-top small {
  color: var(--muted);
}

.shared-audio-player {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(97, 202, 211, 0.2);
  border-radius: 6px;
  background: rgba(7, 17, 19, 0.55);
  color: #b9f0f4;
  cursor: pointer;
}

.shared-audio-wave {
  height: 34px;
  display: flex;
  flex: 1;
  align-items: center;
  gap: 4px;
}

.shared-audio-wave i {
  width: 3px;
  height: 42%;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.65;
}

.shared-audio-wave i:nth-child(2n) { height: 76%; }
.shared-audio-wave i:nth-child(3n) { height: 100%; }
.shared-audio-player.is-playing .shared-audio-wave i { animation: shared-wave 720ms ease-in-out infinite alternate; }
.shared-audio-player.is-playing .shared-audio-wave i:nth-child(2n) { animation-delay: -260ms; }

@keyframes shared-wave {
  from { transform: scaleY(0.45); }
  to { transform: scaleY(1); }
}

@media (max-width: 1100px) {
  .shared-scene-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .shared-scene-page {
    width: min(100% - 28px, 1200px);
  }
}

@media (max-width: 900px) {
  .shared-scene-layout {
    grid-template-columns: 1fr;
  }

  .shared-scene-aside {
    position: static;
  }

  .shared-comments {
    max-height: none;
    min-height: 0;
  }

  .shared-comments .comment-list {
    max-height: 440px;
  }

  .shared-context-card,
  .shared-creator-card,
  .shared-aside-note {
    display: none;
  }
}

@media (max-width: 620px) {
  .shared-scene-page {
    width: 100%;
  }

  .shared-scene-header {
    padding: 22px 16px 18px;
  }

  .shared-scene-header h1 {
    font-size: 31px;
  }

  .shared-scene-primary-actions,
  .shared-scene-primary-actions .button {
    width: 100%;
  }

  .shared-scene-warning,
  .shared-earlier,
  .shared-transcript,
  .shared-scene-continue,
  .shared-derived-media {
    margin-right: 14px;
    margin-left: 14px;
  }

  .shared-message-bubble {
    width: calc(100% - 10px);
    padding: 15px;
    font-size: 16px;
  }

  .shared-media-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .shared-media-tabs {
    overflow-x: auto;
  }

  .shared-media-tabs button {
    flex: 1 0 auto;
  }

  .shared-media-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shared-audio-player.is-playing .shared-audio-wave i {
    animation: none;
  }
}
