/* ── F8SIFT in-house teach chatroom + live console ──────────────────────────
   Goldn3y3 aesthetic adapted to sift's blue-accent dark palette.
   Replaces nothing from sift today — adds two new panels: chat + console. */

.f8chat-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 320px;
  background: linear-gradient(180deg,
    rgba(13,17,23,0.98) 0%, rgba(8,12,18,0.98) 100%);
  backdrop-filter: blur(14px);
  border-left: 1px solid rgba(88,166,255,0.3);
  box-shadow: -2px 0 24px rgba(88,166,255,0.08);
  display: flex; flex-direction: column; z-index: 401;
  overflow: hidden;
  font-family: 'JetBrains Mono','Consolas','Fira Code',monospace;
}
.f8chat-panel[hidden] { display: none !important; }
.f8chat-panel::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    0deg, transparent 0, transparent 2px,
    rgba(88,166,255,0.025) 2px, rgba(88,166,255,0.025) 3px);
  opacity: 0.5; z-index: 0;
}

.f8chat-head {
  position: relative; z-index: 1;
  padding: 0.7rem 0.9rem 0.5rem;
  border-bottom: 1px solid rgba(88,166,255,0.3);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
  background: rgba(88,166,255,0.05);
}
.f8chat-title {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.65rem; letter-spacing: 2.5px; text-transform: uppercase;
  color: #58a6ff; font-weight: 700;
}
.f8chat-title .f8chat-eye {
  width: 14px; height: 14px; flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(88,166,255,0.6));
}
.f8chat-status {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #555; transition: background 0.2s, box-shadow 0.2s;
}
.f8chat-status.live { background: #3fb950;
  box-shadow: 0 0 6px #3fb950; animation: f8chatPulse 1.6s infinite; }
.f8chat-status.dead { background: #f85149; }
.f8chat-close {
  background: transparent; border: none; cursor: pointer;
  color: #8b949e; font-size: 1rem; padding: 0 4px; line-height: 1;
}
.f8chat-close:hover { color: #f85149; }
@keyframes f8chatPulse {
  0%,100% { opacity: 1; } 50% { opacity: 0.45; }
}

.f8chat-meta {
  position: relative; z-index: 1;
  padding: 0.4rem 0.9rem;
  font-size: 0.58rem; letter-spacing: 1px;
  color: #8b949e;
  border-bottom: 1px solid rgba(88,166,255,0.15);
  background: rgba(0,0,0,0.4);
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
}
.f8chat-meta code {
  color: #58a6ff; font-family: inherit;
  background: rgba(88,166,255,0.08); padding: 1px 5px; border-radius: 3px;
}

.f8chat-msgs {
  position: relative; z-index: 1;
  flex: 1; overflow-y: auto; padding: 0.6rem 0.7rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  font-size: 0.72rem;
  scrollbar-width: thin; scrollbar-color: rgba(88,166,255,0.3) transparent;
}
.f8chat-msgs::-webkit-scrollbar { width: 6px; }
.f8chat-msgs::-webkit-scrollbar-thumb {
  background: rgba(88,166,255,0.3); border-radius: 3px;
}

.f8chat-msg {
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px 9px; border-radius: 5px;
  border-left: 2px solid rgba(88,166,255,0.4);
  background: rgba(88,166,255,0.04);
  word-break: break-word;
}
.f8chat-msg.self {
  border-left-color: #58a6ff;
  background: rgba(88,166,255,0.1);
}
.f8chat-msg.admin {
  border-left-color: #d29922;
  background: rgba(210,153,34,0.07);
}
.f8chat-msg.system {
  border-left: none; background: rgba(255,255,255,0.025);
  text-align: center; font-style: italic;
  color: #8b949e; font-size: 0.62rem; padding: 4px 8px;
}
.f8chat-row-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.56rem; letter-spacing: 0.5px;
}
.f8chat-from { color: #58a6ff; font-weight: 700; }
.f8chat-msg.admin .f8chat-from { color: #d29922; }
.f8chat-time { color: #6e7681; }
.f8chat-text {
  font-size: 0.72rem; color: #e6edf3;
  line-height: 1.45; white-space: pre-wrap;
}

.f8chat-foot {
  position: relative; z-index: 1;
  padding: 0.55rem; border-top: 1px solid rgba(88,166,255,0.3);
  flex-shrink: 0; display: flex; gap: 0.4rem; align-items: flex-end;
  background: rgba(0,0,0,0.5);
}
.f8chat-input {
  flex: 1; resize: none;
  background: rgba(88,166,255,0.06);
  border: 1px solid rgba(88,166,255,0.3);
  border-radius: 5px;
  color: #e6edf3;
  font-size: 0.72rem; padding: 0.4rem 0.5rem;
  font-family: inherit; outline: none; line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.f8chat-input:focus {
  border-color: #58a6ff;
  box-shadow: 0 0 0 1px rgba(88,166,255,0.3);
}
.f8chat-input:disabled { opacity: 0.4; cursor: not-allowed; }
.f8chat-send {
  padding: 0.4rem 0.7rem;
  background: rgba(88,166,255,0.18);
  border: 1px solid rgba(88,166,255,0.5);
  border-radius: 5px;
  color: #58a6ff;
  font-size: 0.62rem; cursor: pointer;
  letter-spacing: 1.5px; font-weight: 700;
  font-family: inherit; text-transform: uppercase;
  transition: background 0.15s;
}
.f8chat-send:hover:not(:disabled) { background: rgba(88,166,255,0.3); }
.f8chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* Header chat button */
#chat-tab-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(88,166,255,0.08);
  border: 1px solid rgba(88,166,255,0.4);
  color: #58a6ff;
  padding: 4px 10px; border-radius: 5px;
  font-family: 'JetBrains Mono','Consolas',monospace;
  font-size: 0.65rem; letter-spacing: 1.5px; font-weight: 700;
  text-transform: uppercase; cursor: pointer; line-height: 1;
}
#chat-tab-btn:hover { background: rgba(88,166,255,0.18); }
#chat-tab-btn.live {
  background: rgba(88,166,255,0.22) !important;
  box-shadow: 0 0 8px rgba(88,166,255,0.4);
}
#chat-tab-btn .f8chat-pulse {
  width: 6px; height: 6px; border-radius: 50%; background: #3fb950;
  box-shadow: 0 0 5px #3fb950;
}

#share-session-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(210,153,34,0.08);
  border: 1px solid rgba(210,153,34,0.4);
  color: #d29922;
  padding: 4px 10px; border-radius: 5px;
  font-family: 'JetBrains Mono','Consolas',monospace;
  font-size: 0.65rem; letter-spacing: 1.5px; font-weight: 700;
  text-transform: uppercase; cursor: pointer; line-height: 1;
}
#share-session-btn:hover { background: rgba(210,153,34,0.18); }

/* ── Live investigation console ──────────────────────────────────────────── */
.f8console {
  margin-top: 14px;
  background: #02050a;
  border: 1px solid rgba(88,166,255,0.3);
  border-radius: 8px;
  overflow: hidden;
  font-family: 'JetBrains Mono','Consolas','Fira Code',monospace;
  position: relative;
}
.f8console::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    0deg, transparent 0, transparent 2px,
    rgba(88,166,255,0.02) 2px, rgba(88,166,255,0.02) 3px);
}
.f8console-head {
  position: relative; z-index: 1;
  padding: 7px 12px;
  background: linear-gradient(90deg,
    rgba(88,166,255,0.12) 0%, rgba(88,166,255,0.04) 100%);
  border-bottom: 1px solid rgba(88,166,255,0.3);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.62rem; letter-spacing: 2px; text-transform: uppercase;
  color: #58a6ff; font-weight: 700;
}
.f8console-head .f8console-dots {
  display: inline-flex; gap: 5px; margin-right: 10px;
}
.f8console-head .f8console-dots span {
  width: 9px; height: 9px; border-radius: 50%;
}
.f8console-head .f8console-dots span:nth-child(1) { background: #f85149; }
.f8console-head .f8console-dots span:nth-child(2) { background: #d29922; }
.f8console-head .f8console-dots span:nth-child(3) { background: #3fb950; }
.f8console-clear {
  background: transparent; border: 1px solid rgba(88,166,255,0.3);
  color: #58a6ff; padding: 2px 8px;
  font-size: 0.55rem; letter-spacing: 1px;
  border-radius: 3px; cursor: pointer; font-family: inherit;
  text-transform: uppercase;
}
.f8console-clear:hover { background: rgba(88,166,255,0.12); }
.f8console-body {
  position: relative; z-index: 1;
  height: 280px; overflow-y: auto;
  padding: 8px 12px;
  font-size: 0.7rem; line-height: 1.5;
  background: #02050a;
  scrollbar-width: thin; scrollbar-color: rgba(88,166,255,0.3) transparent;
}
.f8console-body::-webkit-scrollbar { width: 6px; }
.f8console-body::-webkit-scrollbar-thumb {
  background: rgba(88,166,255,0.3); border-radius: 3px;
}
.f8console-line {
  display: grid; grid-template-columns: 70px 1fr;
  gap: 8px; padding: 1px 0;
  white-space: pre-wrap; word-break: break-word;
}
.f8console-ts { color: #6e7681; font-size: 0.65rem; }
.f8console-msg { color: #c9d1d9; }
.f8console-line.tool .f8console-msg { color: #79c0ff; }
.f8console-line.tool-done .f8console-msg { color: #3fb950; }
.f8console-line.tool-running .f8console-msg { color: #d29922; }
.f8console-line.error .f8console-msg { color: #f85149; }
.f8console-line.complete .f8console-msg { color: #3fb950; font-weight: 700; }
.f8console-line.system .f8console-msg { color: #8b949e; font-style: italic; }
.f8console-line.cmd .f8console-msg::before {
  content: '$ '; color: #58a6ff; font-weight: 700;
}
.f8console-empty {
  color: #6e7681; font-style: italic; padding: 14px 0;
  text-align: center;
}
