/**
 * Void channel-view preview — mirrored from packages/ui
 * (GuildRail, ChannelSidebar, UserBar, MainPanel, ChannelChatView).
 */

.app-mock {
  --voice-accent: #5865f2;
  --voice-accent-hover: #4752c4;
  --mock-w: 820px;
  --mock-h: 380px;
  width: 100%;
  height: var(--mock-h);
  display: grid;
  grid-template-columns: 72px 240px 3px minmax(0, 1fr);
  background: #101114;
  color: #dbdee1;
  overflow: hidden;
  font-size: 14px;
}

/* —— Guild rail —— */
.app-mock .guild-rail {
  background: #101114;
  padding: 0.7rem 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  min-height: 0;
  overflow: hidden;
}

.app-mock .guild-pill {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #1a1c20;
  color: #fff;
  font-weight: 700;
  cursor: default;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: inherit;
}

.app-mock .guild-pill.active {
  border-radius: 16px;
  background: var(--voice-accent);
}

.app-mock .guild-pill.home {
  border-radius: 16px;
  background: var(--voice-accent);
}

.app-mock .guild-pill.home svg {
  width: 24px;
  height: 24px;
}

.app-mock .guild-pill.dms {
  color: #b5bac1;
}

.app-mock .guild-pill.dms svg {
  width: 22px;
  height: 22px;
}

.app-mock .guild-pill.add {
  color: #3ba55d;
  background: #161719;
}

.app-mock .guild-pill.settings {
  background: #161719;
  color: #b5bac1;
  font-size: 1.1rem;
  margin-top: auto;
}

.app-mock .guild-separator {
  width: 32px;
  border-top: 2px solid #2e3035;
  flex-shrink: 0;
}

.app-mock .guild-rail-scroll {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  overflow: hidden;
}

.app-mock .guild-pill.has-voice {
  position: relative;
}

.app-mock .guild-pill.has-voice::after {
  content: '';
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #23a55a;
  border: 2px solid #101114;
}

/* —— Sidebar dock —— */
.app-mock .sidebar-dock {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: #14161a;
  border-right: 1px solid #0e1013;
}

.app-mock .channel-sidebar {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #14161a;
}

.app-mock .sidebar-header {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid #121417;
  font-weight: 600;
  font-size: 1rem;
  color: #f2f3f5;
}

.app-mock .sidebar-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0.7rem 0.5rem 0.8rem;
}

.app-mock .group-title {
  display: block;
  margin: 0 0 0.35rem;
  padding: 0.3rem 0.5rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #9a9ea6;
  text-align: center;
  border-bottom: 1px solid color-mix(in srgb, var(--voice-accent) 35%, transparent);
}

.app-mock .channel-block {
  margin: 0 0 0.25rem 0.5rem;
}

.app-mock .sidebar-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.2rem;
}

.app-mock .sidebar-item {
  width: 100%;
  display: flex;
  align-items: center;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  background: transparent;
  color: #b5bac1;
  text-align: left;
  cursor: default;
  font-size: 0.88rem;
}

.app-mock .sidebar-item.active {
  background: rgba(255, 255, 255, 0.075);
  color: #f2f3f5;
}

/* Default app setting: voiceChannelInAccentColor = true */
.app-mock .sidebar-item.voice-live,
.app-mock .sidebar-item.active.voice-live {
  color: var(--voice-accent);
}

.app-mock .sidebar-item .channel-icon {
  flex-shrink: 0;
  margin-right: 0.5rem;
  opacity: 0.72;
  width: 18px;
  height: 18px;
}

.app-mock .sidebar-item.active .channel-icon,
.app-mock .sidebar-item.voice-live .channel-icon {
  opacity: 1;
}

.app-mock .sidebar-item.voice-live .channel-icon {
  color: var(--voice-accent);
}

.app-mock .sidebar-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-mock .sidebar-channel-users {
  list-style: none;
  margin: 0 0 0.35rem;
  padding: 0 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.app-mock .sidebar-channel-user-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #949ba4;
  font-size: 0.91rem;
  padding-left: 0.25rem;
}

.app-mock .avatar-round-wrap {
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
  background: #1a1c20;
}

.app-mock .avatar-round-inner {
  display: block;
  width: 100%;
  height: 100%;
}

.app-mock .avatar-round-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-mock .channel-message-avatar-wrap,
.app-mock .sidebar-participant-avatar-wrap {
  width: 20px;
  height: 20px;
}

.app-mock .user-bar-avatar-wrap {
  width: 32px;
  height: 32px;
}

.app-mock .participant-status-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-mock .status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #1a6b3a;
}

.app-mock .status-dot.speaking {
  background: #23a55a;
  box-shadow: 0 0 4px #23a55a;
}

.app-mock .participant-screen-btn {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--voice-accent);
  padding: 2px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  cursor: default;
}

.app-mock .participant-screen-btn svg {
  width: 14px;
  height: 14px;
}

/* —— User bar card —— */
.app-mock .user-bar-wrap {
  flex-shrink: 0;
  margin: auto 0.5rem 0.55rem;
  background: #121417;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 6px 18px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.app-mock .user-bar-session {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.45rem 0.5rem 0;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.app-mock .user-bar-session-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--voice-accent);
  flex-shrink: 0;
}

.app-mock .user-bar-session-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--voice-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-mock .user-bar {
  padding: 0.5rem 0.55rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
}

.app-mock .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--voice-accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.9rem;
}

.app-mock .user-name {
  margin: 0;
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f2f3f5;
}

.app-mock .user-sub {
  margin: 0;
  color: #949ba4;
  font-size: 0.72rem;
}

.app-mock .user-sub--good {
  color: #57f287;
}

.app-mock .user-sub--warn {
  color: #f0b232;
}

.app-mock .user-sub--bad {
  color: #ed4245;
}

.app-mock .user-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.app-mock .user-action-btn {
  border: none;
  border-radius: 6px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  color: #b5bac1;
  cursor: default;
}

.app-mock .user-action-btn svg {
  width: 16px;
  height: 16px;
}

.app-mock .user-action-separator {
  width: 1px;
  height: 18px;
  background: #2e3035;
  margin: 0 2px;
}

.app-mock .user-action-btn.leave {
  color: #d4494d;
}

/* —— Resize handle —— */
.app-mock .panel-resize-handle {
  background: #121417;
}

/* —— Main panel / chat —— */
.app-mock .main-panel {
  background: #181a1e;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.app-mock .main-topbar {
  height: 48px;
  border-bottom: 1px solid #121417;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0 1rem;
  flex-shrink: 0;
}

.app-mock .main-topbar h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #f2f3f5;
}

.app-mock .top-meta {
  color: #949ba4;
  font-size: 0.83rem;
}

.app-mock .main-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.9rem 1rem;
  overflow: hidden;
}

.app-mock .channel-chat-messages-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  margin-bottom: 0.7rem;
}

.app-mock .channel-message-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.app-mock .channel-message-item {
  position: relative;
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 7px;
  box-sizing: border-box;
}

.app-mock .channel-message-item-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: fit-content;
  max-width: 82%;
  min-width: 0;
}

.app-mock .channel-message-item.other .channel-message-item-inner {
  margin-right: auto;
}

.app-mock .channel-message-item.mine {
  text-align: right;
}

.app-mock .channel-message-item.mine .channel-message-item-inner {
  align-items: flex-end;
  margin-left: auto;
}

.app-mock .channel-message-item.mine .channel-message-author {
  margin-right: 0;
  margin-left: 0.45rem;
}

.app-mock .channel-message-meta {
  margin: 0 0 0.12rem;
  color: #949ba4;
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.app-mock .channel-message-author {
  font-weight: 600;
  margin-right: 0.45rem;
}

.app-mock .channel-message-body-row {
  max-width: 100%;
}

.app-mock .channel-message-text {
  margin: 0;
  color: #dbdee1;
  font-size: 0.92rem;
  line-height: 1.35;
}

.app-mock .channel-message-time {
  display: inline;
  margin-left: 0.4rem;
  font-size: 0.68rem;
  line-height: 1.2;
  color: #72767d;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  vertical-align: baseline;
}

.app-mock .channel-chat-input-wrap {
  margin: 0 0.35rem;
  border-radius: 8px;
  background: #24262b;
  border: 1px solid #3a3d43;
  overflow: hidden;
  flex-shrink: 0;
}

.app-mock .channel-chat-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.45rem;
}

.app-mock .channel-chat-input-placeholder {
  flex: 1;
  min-width: 0;
  color: #72767d;
  font-size: 0.875rem;
  padding: 0.34rem 0.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-mock .channel-chat-attach-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: var(--voice-accent);
  color: #fff;
  cursor: default;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.app-mock .channel-chat-send-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--voice-accent) 50%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--voice-accent) 28%, transparent);
  color: #fff;
  cursor: default;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.app-mock .message-send-icon {
  width: 16px;
  height: 16px;
  display: block;
}

/*
 * Narrow viewports: keep full desktop layout, scroll horizontally
 * instead of clipping or hiding rails/sidebar.
 */
@media (max-width: 860px) {
  .preview {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
  }

  .preview::-webkit-scrollbar {
    height: 6px;
  }

  .preview::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
  }

  .app-mock {
    width: var(--mock-w);
    min-width: var(--mock-w);
    height: var(--mock-h);
  }
}
