body.messenger-page {
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(123, 75, 181, 0.24), transparent 28%),
    linear-gradient(180deg, #efe7fb 0%, #e3d6f4 48%, #d9caef 100%);
}

.messenger-shell {
  display: grid;
  grid-template-columns: 84px 360px minmax(0, 1fr);
  height: 100vh;
  gap: 0;
}

.messenger-rail,
.messenger-sidebar,
.messenger-main {
  min-height: 0;
}

.messenger-rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 12px;
  background: rgba(61, 29, 99, 0.95);
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.messenger-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.messenger-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #8e66cc, #5c2d91);
  font-size: 18px;
  font-weight: bold;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.24);
}

.messenger-brand-title {
  font-size: 13px;
  font-weight: 700;
}

.messenger-brand-subtitle {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.72);
}

.rail-btn {
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: inherit;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  transition: background 0.18s ease, transform 0.18s ease;
}

.rail-btn:hover,
.rail-btn.active {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.rail-btn-ghost {
  color: rgba(255, 255, 255, 0.88);
}

.rail-btn-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.rail-btn-icon .yoyo-icon {
  width: 18px;
  height: 18px;
}

.rail-spacer {
  flex: 1;
}

.messenger-sidebar {
  display: flex;
  flex-direction: column;
  margin: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.75);
  border-right: 1px solid rgba(92, 45, 145, 0.14);
  backdrop-filter: blur(16px);
}

.sidebar-top {
  padding: 20px 18px 14px;
  border-bottom: 1px solid rgba(92, 45, 145, 0.1);
}

.my-profile-card {
  border-radius: 0;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(240,232,248,0.96));
  border: 1px solid rgba(92, 45, 145, 0.1);
  box-shadow: none;
}

.my-profile-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.my-profile-copy {
  min-width: 0;
  flex: 1;
}

.my-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ym-purple-dark);
}

.my-hint {
  margin-top: 3px;
  font-size: 11px;
  color: #6d5b85;
}

#btn-sounds {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(92, 45, 145, 0.12);
  background: #fff;
  color: var(--ym-purple);
}

#btn-sounds .yoyo-icon {
  width: 18px;
  height: 18px;
}

.my-status-controls {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.my-status-controls select,
.my-status-msg,
.search-box input {
  width: 100%;
  border: 1px solid rgba(92, 45, 145, 0.16);
  background: rgba(255,255,255,0.95);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 12px;
}

.search-box {
  margin-top: 14px;
  padding: 0;
  border-bottom: 0;
  position: relative;
}

.yoyo-search-wrap .yoyo-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #8e79ab;
}

.search-box input {
  padding-left: 34px;
}

.sidebar-filter-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.stories-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stories-section-eyebrow,
.stories-hero-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7b6696;
}
.story-feed-card:hover {
  border-color: rgba(92, 45, 145, 0.18);
  transform: translateY(-1px);
}

.story-ring {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #d7c4f0, #b696e3);
}

.story-ring .buddy-avatar {
  width: 100%;
  height: 100%;
  border-radius: 15px;
}

.story-ring.has-unviewed,
.story-ring--mine.has-story {
  background: linear-gradient(180deg, #8e66cc, #5c2d91);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.75);
}

.story-ring.is-viewed {
  background: linear-gradient(180deg, #d3c7e4, #b7aaca);
}

.story-feed-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.story-feed-copy strong {
  font-size: 13px;
  color: #2f1b47;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-feed-copy span,
.story-feed-meta {
  font-size: 11px;
  color: #746288;
}

.story-feed-card {
  border: 1px solid rgba(92, 45, 145, 0.08);
  background: rgba(255,255,255,0.88);
  border-radius: 18px;
  padding: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.story-feed-card.is-own {
  border-color: rgba(92, 45, 145, 0.16);
  background: linear-gradient(180deg, rgba(247,243,253,0.98), rgba(239,232,249,0.98));
  box-shadow: 0 10px 24px rgba(92, 45, 145, 0.08);
}

.story-feed-card.is-own .story-feed-copy strong {
  color: #452464;
}

.story-feed-card.is-own .story-feed-count {
  background: linear-gradient(180deg, #7b4bb5, #5c2d91);
  color: #fff;
}

.story-feed-count {
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(92, 45, 145, 0.1);
  color: var(--ym-purple-dark);
  font-size: 11px;
  font-weight: 700;
}

.sidebar-filter {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(92, 45, 145, 0.08);
  color: var(--ym-purple-dark);
  font-size: 11px;
  font-weight: 600;
}

.sidebar-filter.active {
  background: linear-gradient(180deg, #7b4bb5, #5c2d91);
  color: #fff;
}

.sidebar-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #6d5b85;
}

.buddy-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  margin: 0;
  background: transparent;
}

.buddy-group {
  margin-bottom: 14px;
}

.buddy-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  color: #7b6696;
  font-size: 11px;
  font-weight: 700;
  background: transparent;
  border: 0;
}

.buddy-group-header:hover {
  background: rgba(92, 45, 145, 0.04);
  border-radius: 12px;
}

.buddy-group-count {
  margin-left: auto;
  font-size: 10px;
  color: #a28dbd;
}

.buddy-group.collapsed .buddy-list {
  display: none;
}

.buddy-list {
  list-style: none;
  display: grid;
  gap: 0;
  margin: 0;
}

.buddy-item {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 0;
  background: rgba(255,255,255,0.9);
  border: 0;
  border-bottom: 1px solid rgba(92, 45, 145, 0.08);
  box-shadow: none;
  font-size: 12px;
}

.buddy-item:hover {
  background: rgba(255,255,255,0.98);
  border-color: rgba(92, 45, 145, 0.18);
}

.buddy-item.selected {
  background: linear-gradient(180deg, rgba(123,75,181,0.95), rgba(92,45,145,0.98));
  color: #fff;
  box-shadow: 0 16px 28px rgba(92, 45, 145, 0.28);
}

.buddy-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(180deg, #8e66cc, #5c2d91);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.buddy-avatar-button {
  border: 0;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.buddy-avatar-button:disabled {
  cursor: default;
}

.buddy-story-ring {
  width: 48px;
  height: 48px;
  padding: 3px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.buddy-story-ring.has-unviewed {
  background: linear-gradient(180deg, #8e66cc, #5c2d91);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.82);
}

.buddy-story-ring.is-viewed {
  background: linear-gradient(180deg, #d3c7e4, #b7aaca);
}

.buddy-story-ring .buddy-avatar {
  width: 100%;
  height: 100%;
}

.buddy-avatar-img {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: transparent;
}

.buddy-info {
  min-width: 0;
}

.buddy-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.buddy-status-msg {
  margin-top: 4px;
  color: #746288;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.buddy-item.selected .buddy-status-msg,
.buddy-item.selected .buddy-name {
  color: #fff;
}

.buddy-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #22c55e;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.buddy-item.selected .buddy-unread {
  background: #fff;
  color: var(--ym-purple-dark);
}

.buddy-item-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.buddy-time {
  font-size: 10px;
  font-weight: 600;
  color: #8a779c;
  white-space: nowrap;
}

.buddy-item.selected .buddy-time {
  color: rgba(255, 255, 255, 0.86);
}

.buddy-room-tag {
  display: inline-flex;
  align-items: center;
  margin-inline-start: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b4f91;
  background: rgba(92, 45, 145, 0.1);
}

.buddy-item.selected .buddy-room-tag {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.buddy-avatar-room {
  background: linear-gradient(180deg, #7d5bb5, #4f247d);
}

.buddy-item-room .status-dot.available {
  background: #8e66cc;
}

.buddy-more-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 10px;
  background: rgba(92, 45, 145, 0.08);
  color: #6d5b85;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.buddy-more-btn:hover {
  background: rgba(92, 45, 145, 0.14);
  color: var(--ym-purple-dark);
}

.buddy-item.selected .buddy-more-btn {
  background: rgba(255,255,255,0.16);
  color: #fff;
}

.buddy-item.selected .buddy-story-ring.has-unviewed,
.buddy-item.selected .buddy-story-ring.is-viewed {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.28);
}

.buddy-preview {
  color: #433254;
  font-weight: 600;
}

.buddy-pin,
.buddy-mute {
  color: inherit;
}

.messenger-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  border-radius: 0;
  background: rgba(255,255,255,0.55);
}

.workspace-body {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 0;
  margin: 0;
}

.workspace-empty,
.workspace-frame,
.devices-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.workspace-empty {
  display: grid;
  place-items: center;
}

.workspace-empty-card,
.devices-panel {
  border-radius: 0;
  background: rgba(255,255,255,0.88);
  border: 0;
  box-shadow: none;
}

.workspace-empty-card {
  max-width: 620px;
  padding: 40px;
  text-align: center;
}

.workspace-empty-card h2 {
  font-size: 28px;
  color: #2f1b47;
  margin-bottom: 12px;
}

.workspace-empty-card p {
  font-size: 14px;
  line-height: 1.6;
  color: #6b5a82;
}

.workspace-empty-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 22px;
}

.workspace-frame {
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  margin: 0;
}

#chat-frame.workspace-frame {
  background: #f3eef8;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  overflow: hidden;
}

.devices-panel {
  padding: 24px;
  overflow: auto;
}

.stories-panel {
  height: 100%;
  overflow: auto;
  padding: 24px;
  margin: 0;
  border-radius: 0;
  background: rgba(255,255,255,0.88);
  border: 0;
  box-shadow: none;
}

.stories-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 22px 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(92,45,145,0.95), rgba(142,102,204,0.92));
  color: #fff;
}

.stories-hero h2 {
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.2;
}

.stories-hero p {
  margin-top: 10px;
  max-width: 720px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,0.88);
}

.stories-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stories-panel-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.stories-column {
  min-width: 0;
}

.stories-my-card,
.stories-feed-grid {
  margin-top: 14px;
}

.stories-feed-priority:empty {
  display: none;
}

.stories-feed-priority {
  margin-top: 14px;
}

.stories-my-card {
  display: grid;
  gap: 12px;
}

.stories-my-summary {
  border-radius: 22px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(247,243,253,0.98), rgba(235,226,246,0.98));
  border: 1px solid rgba(92, 45, 145, 0.1);
}

.stories-my-summary h3 {
  font-size: 18px;
  color: #2f1b47;
}

.stories-my-summary p {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: #695881;
}

.stories-meta-pills {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stories-meta-pill {
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(92, 45, 145, 0.08);
  color: #52346f;
  font-size: 11px;
  font-weight: 700;
}

.stories-own-list {
  display: grid;
  gap: 10px;
}

.story-own-card {
  width: 100%;
  border: 1px solid rgba(92, 45, 145, 0.1);
  border-radius: 20px;
  background: rgba(255,255,255,0.92);
  padding: 16px;
  display: grid;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.story-own-card:hover {
  border-color: rgba(92, 45, 145, 0.22);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(92, 45, 145, 0.1);
}

.story-own-card-head,
.story-own-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.story-own-kind {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(92, 45, 145, 0.08);
  color: #52346f;
  font-size: 11px;
  font-weight: 700;
}

.story-own-time,
.story-own-meta {
  font-size: 11px;
  color: #75658a;
}

.story-own-body {
  font-size: 13px;
  line-height: 1.6;
  color: #2f1b47;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stories-feed-grid {
  display: grid;
  gap: 12px;
}

.story-empty-card {
  border-radius: 22px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(250,247,253,0.98), rgba(241,234,249,0.98));
  border: 1px dashed rgba(92, 45, 145, 0.18);
  color: #644e7f;
}

.story-empty-card strong {
  display: block;
  font-size: 16px;
  color: #2f1b47;
}

.story-empty-card span {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
}

.story-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(calc(100vh - 32px), 920px);
  min-width: 0;
  border-radius: 24px;
  border-width: 1px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(241,234,249,0.98));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.story-dialog .ym-dialog-header,
.story-dialog .ym-dialog-footer {
  position: relative;
  z-index: 1;
}

.story-dialog .ym-dialog-footer {
  border-top: 1px solid rgba(92, 45, 145, 0.1);
  background: linear-gradient(180deg, rgba(250,247,253,0.98), rgba(241,234,249,0.98));
}

.story-dialog-body {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 12px;
}

.story-dialog-body.has-video-selection {
  gap: 12px;
}

.story-compose-type {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.story-kind-btn {
  border: 1px solid rgba(92, 45, 145, 0.14);
  border-radius: 999px;
  background: rgba(92,45,145,0.06);
  color: #4a3367;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
}

.story-kind-btn.active {
  background: linear-gradient(180deg, #7b4bb5, #5c2d91);
  color: #fff;
}

.story-compose-preview {
  display: flex;
  justify-content: center;
}

.story-preview-card {
  position: relative;
  width: 100%;
  min-height: 280px;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(135deg, #5c2d91, #8e66cc);
  color: #fff;
  display: grid;
  place-items: center;
  padding: 24px;
}

.story-preview-card.is-video {
  min-height: clamp(220px, 34vh, 320px);
}

.story-preview-media,
.story-preview-media img,
.story-preview-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.story-preview-media img,
.story-preview-media video {
  object-fit: cover;
}

.story-preview-text {
  position: relative;
  z-index: 1;
  max-width: 460px;
  text-align: center;
  font-size: 22px;
  line-height: 1.45;
  font-weight: 700;
  white-space: pre-wrap;
  text-shadow: 0 8px 26px rgba(0,0,0,0.26);
}

.story-textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border: 1px solid rgba(92, 45, 145, 0.16);
  border-radius: 14px;
  padding: 12px;
  font-size: 13px;
  background: rgba(255,255,255,0.96);
}

.story-upload-row,
.story-inline-grid {
  display: grid;
  gap: 12px;
}

.story-video-trim {
  border-radius: 18px;
  background: rgba(92,45,145,0.05);
  padding: 14px;
}

.story-video-trim-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.story-video-trim-summary {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: #6f6083;
  text-align: right;
}

.story-trim-field {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: #432b60;
}

.story-trim-field input[type="range"] {
  width: 100%;
}

.story-sound-section {
  border-radius: 18px;
  background: rgba(92,45,145,0.05);
  padding: 14px;
}

.story-dialog-body.has-video-selection .story-video-trim,
.story-dialog-body.has-video-selection .story-sound-section,
.story-dialog-body.has-video-selection .story-audience-picker {
  padding: 12px;
}

.story-sound-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.story-sound-title {
  font-size: 13px;
  font-weight: 700;
  color: #2f1b47;
}

.story-sound-subtitle {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.5;
  color: #75658a;
}

.story-sound-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.story-sound-current {
  margin-top: 12px;
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(92, 45, 145, 0.1);
}

.story-audio-toggle {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #52346f;
}

.story-sounds-library {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.story-sound-card {
  width: 100%;
  border: 1px solid rgba(92, 45, 145, 0.1);
  border-radius: 16px;
  background: rgba(255,255,255,0.9);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.story-sound-card.active {
  border-color: rgba(92, 45, 145, 0.34);
  box-shadow: 0 10px 24px rgba(92, 45, 145, 0.12);
}

.story-sound-copy strong {
  display: block;
  font-size: 13px;
  color: #2f1b47;
}

.story-sound-copy span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #75658a;
}

.story-upload-row {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.story-upload-meta,
.story-audience-label {
  font-size: 12px;
  color: #6f6083;
}

.story-inline-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.story-audience-picker {
  border-radius: 18px;
  background: rgba(92,45,145,0.05);
  padding: 14px;
}

.story-audience-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  max-height: 180px;
  overflow: auto;
}

.story-audience-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #432b60;
}

.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 10020;
  background: rgba(18, 11, 31, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.story-viewer-shell {
  width: min(760px, 100%);
  max-height: 100%;
  overflow: auto;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(27,18,43,0.98), rgba(36,21,57,0.98));
  color: #fff;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  padding: 16px;
}

.story-viewer-top,
.story-viewer-meta,
.story-viewer-nav-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.story-progress {
  flex: 1;
  display: grid;
  grid-auto-flow: column;
  gap: 7px;
}

.story-progress-segment {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(79, 56, 112, 0.95), rgba(56, 38, 82, 0.98));
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.16),
    0 0 0 1px rgba(0,0,0,0.18);
}

.story-progress-fill {
  --story-progress: 0;
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(var(--story-progress));
  background: linear-gradient(90deg, #d8c3ff 0%, #f5ecff 58%, #ffffff 100%);
  background-size: 200% 100%;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.24),
    0 0 14px rgba(255,255,255,0.45);
  will-change: transform;
}

.story-progress-segment.is-complete {
  background: linear-gradient(180deg, rgba(69, 46, 102, 0.96), rgba(49, 33, 73, 0.98));
}

.story-progress-segment.is-complete .story-progress-fill {
  --story-progress: 1;
  background: linear-gradient(90deg, #8f5bff 0%, #bb8cff 52%, #f0ddff 100%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.14),
    0 0 18px rgba(157,112,255,0.38);
}

.story-progress-segment.is-active {
  background: linear-gradient(180deg, rgba(88, 61, 127, 1), rgba(60, 40, 90, 1));
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.22),
    0 0 0 1px rgba(255,255,255,0.08),
    0 0 16px rgba(126, 92, 182, 0.28);
}

.story-progress-segment.is-active .story-progress-fill {
  transition: transform linear;
  background: linear-gradient(90deg, #31e7ff 0%, #8af1ff 24%, #ffffff 50%, #fff0a6 74%, #ff8ad8 100%);
  background-size: 220% 100%;
  animation: story-progress-shimmer 900ms linear infinite;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.34),
    0 0 20px rgba(82, 229, 255, 0.4),
    0 0 28px rgba(255, 138, 216, 0.26);
}

.story-progress-segment:not(.is-active):not(.is-complete) .story-progress-fill {
  opacity: 0;
}

@keyframes story-progress-shimmer {
  from {
    background-position: 0% 0;
  }
  to {
    background-position: 220% 0;
  }
}

.story-viewer-close {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 24px;
}

.story-viewer-meta {
  margin-top: 14px;
}

.story-viewer-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.story-viewer-name {
  font-size: 16px;
  font-weight: 700;
}

.story-viewer-time {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255,255,255,0.74);
}

.story-viewer-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.story-viewer-badge {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.08);
}

.story-viewer-stage {
  position: relative;
  min-height: 420px;
  margin-top: 14px;
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #5c2d91, #8e66cc);
}

.story-viewer-stage img,
.story-viewer-stage video {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  background: rgba(0,0,0,0.22);
}

.story-viewer-text {
  padding: 32px;
  text-align: center;
  font-size: 30px;
  line-height: 1.45;
  font-weight: 700;
  white-space: pre-wrap;
  text-shadow: 0 10px 28px rgba(0,0,0,0.28);
}

.story-reshare-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(18,11,31,0.5);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.story-music-badge {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 1;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(18,11,31,0.5);
  color: #fff;
  font-size: 12px;
}

.story-viewer-caption {
  margin-top: 14px;
  min-height: 18px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,255,255,0.88);
  white-space: pre-wrap;
}

.story-viewer-controls {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.story-viewer-control-grid {
  display: grid;
  gap: 14px;
}

.story-control-head {
  display: grid;
  gap: 14px;
}

.story-control-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 14px 30px rgba(0,0,0,0.14);
}

.story-control-card--actions {
  gap: 14px;
}

.story-control-card--nav {
  gap: 16px;
}

.story-control-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}

.story-control-note {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255,255,255,0.78);
}

.story-reaction-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.story-reaction-btn {
  min-width: 0;
  min-height: 60px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 18px;
  padding: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.story-reaction-btn:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.24);
}

.story-reaction-btn.active {
  background: linear-gradient(180deg, rgba(142,102,204,0.9), rgba(92,45,145,0.95));
  border-color: rgba(255,255,255,0.28);
  box-shadow: 0 12px 24px rgba(92, 45, 145, 0.24);
}

.story-viewer-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.story-viewer-buttons .ym-btn,
.story-viewer-nav-card .ym-btn {
  min-height: 52px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
}

.story-viewer-next {
  max-width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.82);
  text-align: left;
}

.story-viewer-buttons .ym-btn {
  min-width: 0;
  width: 100%;
  padding-left: 16px;
  padding-right: 16px;
}

.story-viewer-nav-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 14px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.1);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
}

.story-viewer-nav-card .ym-btn {
  width: 100%;
}

.devices-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.devices-panel-header h2 {
  font-size: 24px;
  color: #2f1b47;
}

.devices-panel-header p {
  margin-top: 6px;
  color: #6b5a82;
  font-size: 13px;
}

.devices-panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.devices-banner {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(92,45,145,0.1), rgba(92,45,145,0.05));
  color: #52346f;
  font-size: 12px;
  font-weight: 600;
}

.devices-list {
  display: grid;
  gap: 12px;
}

.device-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(92, 45, 145, 0.1);
  background: #fff;
}

.device-copy h3 {
  font-size: 15px;
  color: #2f1b47;
}

.device-meta {
  margin-top: 6px;
  color: #75658a;
  font-size: 12px;
}

.device-meta strong {
  color: var(--ym-purple-dark);
}

.messenger-statusbar {
  display: none !important;
}

.buddy-context-menu {
  position: fixed;
  z-index: 10050;
  min-width: 190px;
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(92, 45, 145, 0.16);
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.18);
  padding: 6px;
}

.buddy-context-menu.hidden {
  display: none;
}

.buddy-context-menu .yoyo-menu-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  padding: 10px 12px;
  font-size: 12px;
  color: #2f1b47;
}

.buddy-context-menu .yoyo-menu-btn:hover {
  background: rgba(92, 45, 145, 0.08);
}

@media (max-width: 1120px) {
  .messenger-shell {
    grid-template-columns: 76px 320px minmax(0, 1fr);
  }

  .conversation-actions {
    display: none;
  }

  .stories-panel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .messenger-shell {
    grid-template-columns: 1fr;
  }

  .messenger-rail {
    display: none;
  }

  .messenger-sidebar {
    display: none;
  }

  .workspace-body {
    padding: 0;
    margin: 0;
  }
}

@media (max-width: 720px) {
  .stories-hero,
  .story-viewer-meta,
  .story-viewer-nav-card {
    flex-direction: column;
    align-items: stretch;
  }

  .story-upload-row,
  .story-inline-grid,
  .story-audience-list {
    grid-template-columns: 1fr;
  }

  .story-sound-head {
    flex-direction: column;
  }

  .story-viewer-stage {
    min-height: 320px;
  }

  .story-viewer-text {
    font-size: 24px;
  }

  .story-viewer-next,
  .story-viewer-buttons {
    text-align: left;
  }

  .story-viewer-nav-card {
    grid-template-columns: 1fr;
  }
}
