/* ─── UNIT-7 private line ─────────────────────────────────────────────────────
   Same palette and face as the tutorial (tutorial.css), so the robot that ran
   orientation is recognisably the one answering. Docked bottom-right above
   the chat column; on phones it takes the width and sits above the bottom nav.
   z-index: above the mobile nav (9992) and drawer (9995), below the tutorial
   overlay (99999), which is the one thing allowed to cover it. */
#fm-guide {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: 520px;
  max-height: calc(100vh - 90px);
  z-index: 9998;
  display: none;
  flex-direction: column;
  background: rgba(4, 6, 4, .97);
  border: 1px solid #1a3a1a;
  border-radius: 6px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .75), 0 0 40px rgba(0, 255, 0, .04);
  font-family: monospace;
  color: #6fb88c;
  overflow: hidden;
}
#fm-guide.open { display: flex; animation: fgRise .22s ease-out; }
/* Once dragged (or opened with a saved position) it is placed by left/top. */
#fm-guide.fg-placed { right: auto; bottom: auto; }
/* Desktop: the reader can make it taller for long answers. */
@media (min-width: 701px) { #fm-guide { resize: both; min-width: 300px; min-height: 320px; } }
@keyframes fgRise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

.fg-head {
  display: flex; align-items: center; gap: 10px;
  cursor: move; touch-action: none; user-select: none;
  padding: 10px 10px 10px 12px;
  border-bottom: 1px solid #132813;
  flex: 0 0 auto;
}
.fg-face {
  width: 46px; height: 46px; flex: 0 0 46px;
  border: 1px solid #1a3a1a; background: #050505; overflow: hidden;
}
.fg-face img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block; }
.fg-id { flex: 1; min-width: 0; }
.fg-name { font-size: 15px; letter-spacing: .18em; color: #3a8a3a; }
.fg-sub { font-size: 11px; letter-spacing: .06em; color: #2a5a2a; margin-top: 2px; }
.fg-x {
  background: none; border: 1px solid #1a3a1a; color: #3a8a3a;
  width: 28px; height: 28px; border-radius: 4px; cursor: pointer; font-size: 18px; line-height: 1;
}
.fg-x:hover, .fg-x:focus-visible { border-color: #3a8a3a; color: #6fb88c; outline: none; }

.fg-log {
  flex: 1 1 auto; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,255,0,.012) 2px, rgba(0,255,0,.012) 4px);
}
.fg-msg { font-size: calc(13px * var(--chat-font-scale, 1)); line-height: 1.6; max-width: 92%; word-wrap: break-word; }
.fg-you {
  align-self: flex-end; color: #f0b454;
  background: rgba(240, 180, 84, .06); border: 1px solid rgba(240, 180, 84, .18);
  border-radius: 6px 6px 2px 6px; padding: 6px 10px;
}
.fg-bot { align-self: flex-start; border-left: 2px solid #2a6a2a; padding: 2px 0 2px 10px; }
.fg-miss { border-left-color: #6a4a1a; }
.fg-miss .fg-text { color: #b8a06f; }
.fg-title { color: #3aff3a; opacity: .85; font-size: .9em; letter-spacing: .12em; margin-bottom: 3px; }
.fg-text { color: #6fb88c; }

.fg-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.fg-chip {
  font-family: monospace; font-size: 11px; color: #4eaa4e;
  background: #071007; border: 1px solid #1a3a1a; border-radius: 12px;
  padding: 3px 9px; cursor: pointer;
}
.fg-chip:hover, .fg-chip:focus-visible { border-color: #3a8a3a; color: #9dffb0; outline: none; }

.fg-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.fg-dots i { width: 5px; height: 5px; border-radius: 50%; background: #3a8a3a; animation: fgBlink 1s infinite; }
.fg-dots i:nth-child(2) { animation-delay: .15s; }
.fg-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes fgBlink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }

.fg-in { display: flex; gap: 6px; padding: 10px; border-top: 1px solid #132813; flex: 0 0 auto; }
.fg-q {
  flex: 1; min-width: 0; font-family: monospace; font-size: 13px;
  background: #050805; color: #9dffb0; border: 1px solid #1a3a1a; border-radius: 4px; padding: 7px 9px;
}
.fg-q:focus { outline: none; border-color: #3a8a3a; box-shadow: 0 0 0 1px rgba(58, 138, 58, .35); }
.fg-send {
  font-family: monospace; font-size: 13px; letter-spacing: .08em;
  background: #0a1a0a; color: #3aff3a; border: 1px solid #2a6a2a; border-radius: 4px;
  padding: 0 14px; cursor: pointer;
}
.fg-send:disabled { opacity: .45; cursor: default; }
.fg-send:not(:disabled):hover, .fg-send:focus-visible { border-color: #3aff3a; outline: none; }
.fg-foot { font-size: 10.5px; color: #2a5a2a; padding: 0 10px 9px; flex: 0 0 auto; }

/* The chat line UNIT-7 speaks in. Its name opens the private line. */
.chat-msg.cm-guide .chat-username { cursor: pointer; }
.chat-msg.cm-guide .chat-avatar-w { background: #050505; }

@media (max-width: 700px) {
  .fg-head { cursor: default; }
  #fm-guide, #fm-guide.fg-placed {
    right: 8px; left: 8px; width: auto; max-width: none;
    bottom: calc(var(--fm-nav, 58px) + 8px + env(safe-area-inset-bottom, 0px));
    height: auto; top: 70px; max-height: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  #fm-guide.open { animation: none; }
  .fg-dots i { animation: none; opacity: .7; }
}
