#hover-chat {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: 'Courier New', 'Lucida Console', Monaco, monospace;
}

#chat-bubble {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #0a0a0a;
  color: #00ff41;
  border: 1px solid #00cc33;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

#chat-bubble svg { stroke: #00ff41; }

#chat-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.4);
}

#chat-bubble.active {
  background: #0f1a0f;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.35);
}

#chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff3333;
  color: #0a0a0a;
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#chat-panel {
  display: none;
  flex-direction: column;
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 340px;
  height: 420px;
  background: #0a0a0a;
  border: 1px solid #1a3a1a;
  border-radius: 4px;
  box-shadow: 0 0 24px rgba(0, 255, 65, 0.1);
  overflow: hidden;
}

#chat-panel.open {
  display: flex;
}

#chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #0d0d0d;
  color: #00ff41;
  font-weight: normal;
  font-size: 13px;
  border-bottom: 1px solid #1a3a1a;
}

#chat-online {
  font-size: 11px;
  color: #00aa2a;
}

#chat-close {
  background: none;
  border: none;
  color: #00ff41;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  font-family: inherit;
}

#chat-close:hover {
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #0a0a0a;
}

#chat-messages::-webkit-scrollbar { width: 6px; }
#chat-messages::-webkit-scrollbar-track { background: #0a0a0a; }
#chat-messages::-webkit-scrollbar-thumb { background: #1a3a1a; border-radius: 3px; }

.chat-msg {
  padding: 5px 8px;
  background: transparent;
  border-left: 2px solid #1a3a1a;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
  color: #00cc33;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #1a3a1a;
  flex-shrink: 0;
  object-fit: cover;
}

.chat-avatar-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #1a3a1a;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a5a1a;
  font-size: 13px;
  font-weight: bold;
  background: #0d0d0d;
}

.chat-msg-body {
  flex: 1;
  min-width: 0;
}

.chat-msg strong {
  color: #00ff41;
  margin-right: 4px;
}

.chat-msg small {
  display: block;
  color: #1a5a1a;
  font-size: 10px;
  margin-top: 2px;
}

.chat-link {
  color: #00ccff;
  text-decoration: underline;
  word-break: break-all;
}
.chat-link:hover {
  color: #33ddff;
  text-shadow: 0 0 4px rgba(0, 204, 255, 0.3);
}

/* Link preview card */
.chat-link-preview {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  padding: 6px;
  background: #0d0d0d;
  border: 1px solid #1a3a1a;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  max-width: 280px;
}
.chat-preview-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}
.chat-preview-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.chat-preview-title {
  color: #00ff41;
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-preview-desc {
  color: #00aa2a;
  font-size: 10px;
  margin-top: 2px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chat-preview-site {
  color: #1a5a1a;
  font-size: 9px;
  margin-top: 3px;
}
.chat-preview-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

#chat-form {
  display: flex;
  border-top: 1px solid #1a3a1a;
  background: #0d0d0d;
}

#chat-input {
  flex: 1;
  border: none;
  background: transparent;
  color: #00ff41;
  padding: 10px 12px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  outline: none;
  max-width: none;
  width: auto;
  margin: 0;
}

#chat-input::placeholder {
  color: #1a5a1a;
}

#chat-form button {
  border: none;
  border-left: 1px solid #1a3a1a;
  background: transparent;
  color: #00ff41;
  padding: 10px 14px;
  font-weight: normal;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  margin: 0;
}

#chat-form button:hover {
  background: #0f1a0f;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
  box-shadow: none;
}

#chat-voice {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
}

#chat-voice svg {
  stroke: #00ff41;
}

.chat-load-more {
  text-align: center;
  color: #00aa2a;
  font-size: 11px;
  padding: 6px 0;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.chat-load-more:hover {
  opacity: 1;
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.3);
}

.chat-system {
  border-left: 2px solid #1a3a1a;
  color: #1a5a1a;
  font-size: 11px;
  font-style: italic;
  padding: 3px 8px;
  background: transparent;
}

/* Chat tabs */
#chat-tabs {
  display: flex;
  border-bottom: 1px solid #1a3a1a;
  background: #0d0d0d;
  overflow-x: auto;
  flex-shrink: 0;
}

#chat-tabs::-webkit-scrollbar { height: 0; }

.chat-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: #1a5a1a;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s, border-bottom-color 0.15s;
}

.chat-tab:hover {
  color: #00cc33;
  background: rgba(0, 255, 65, 0.04);
  box-shadow: none;
  text-shadow: none;
}

.chat-tab.active {
  color: #00ff41;
  border-bottom-color: #00ff41;
}

.chat-tab-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 13px;
  padding: 0;
  margin: 0;
  cursor: pointer;
  line-height: 1;
  opacity: 0.6;
  font-family: inherit;
}

.chat-tab-close:hover {
  opacity: 1;
  box-shadow: none;
  background: none;
}

/* Command autocomplete dropdown */
#cmd-suggest {
  display: none;
  position: absolute;
  bottom: 42px; /* sits just above #chat-form */
  left: 0;
  right: 0;
  background: #0a0a0a;
  border-top: 1px solid #1a3a1a;
  border-bottom: 1px solid #0a0a0a;
  z-index: 10;
  max-height: 180px;
  overflow-y: auto;
}

#cmd-suggest.open {
  display: block;
}

.cmd-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  border-left: 2px solid transparent;
  transition: background 0.1s;
}

.cmd-item:hover,
.cmd-item.active {
  background: #0f1a0f;
  border-left-color: #00ff41;
}

.cmd-item .cmd-name {
  color: #00ff41;
  white-space: nowrap;
  flex-shrink: 0;
}

.cmd-item .cmd-hint {
  color: #1a5a1a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
