/* RMFC chat assistant (built by assets/chat.js) */
.rmfc-chat {
  --rc-lift: 0px;
  position: fixed; right: 20px; bottom: calc(20px + var(--rc-lift)); z-index: 70;
  font-family: var(--font-display, sans-serif);
}
.rc-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 20px 0 16px;
  background: var(--accent, #00FF00); color: var(--ink-inverse, #0A0A0A); border: 0; cursor: pointer;
  font: 700 14px var(--font-display, sans-serif);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 24px var(--accent-glow-strong, rgba(0, 255, 0, 0.25));
  transition: background 0.2s;
}
.rc-btn:hover { background: var(--ink, #EDEDED); }
.rc-btn:focus-visible { outline: 2px solid var(--ink, #EDEDED); outline-offset: 3px; }
.rc-btn svg { width: 24px; height: 24px; flex: none; }
.rmfc-chat.open .rc-btn-txt, .rmfc-chat.compact .rc-btn-txt { display: none; }
.rmfc-chat.open .rc-btn, .rmfc-chat.compact .rc-btn { padding: 0 16px; }

.rc-panel {
  position: absolute; right: 0; bottom: 68px;
  width: 380px; height: min(600px, calc(100vh - 120px - var(--rc-lift)));
  display: flex; flex-direction: column;
  background: var(--bg, #0A0A0A); border: 1px solid var(--border-strong, #333);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.rc-panel[hidden] { display: none; }
.rc-panel::before { content: ""; position: absolute; top: -1px; left: -1px; width: 80px; height: 2px; background: var(--accent, #00FF00); }
.rc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border, #262626); }
.rc-head b { display: block; font-weight: 700; font-size: 15px; color: var(--ink, #EDEDED); }
.rc-head span { display: block; margin-top: 2px; font-family: var(--font-mono, monospace); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted, #888); }
.rc-close { flex: none; width: 34px; height: 34px; background: transparent; border: 1px solid var(--border-strong, #333); color: var(--ink-dim, #C8C8C8); font-size: 20px; line-height: 1; cursor: pointer; }
.rc-close:hover { border-color: var(--accent, #00FF00); color: var(--accent, #00FF00); }

.rc-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.rc-msg { max-width: 88%; padding: 10px 12px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.rc-bot { align-self: flex-start; background: var(--bg-elev-1, #141414); border: 1px solid var(--border, #262626); border-left: 2px solid var(--accent, #00FF00); color: var(--ink-dim, #C8C8C8); }
.rc-user { align-self: flex-end; background: rgba(0, 255, 0, 0.08); border: 1px solid rgba(0, 255, 0, 0.35); color: var(--ink, #EDEDED); }
.rc-msg ul { list-style: none; margin: 8px 0 0; padding: 0; white-space: normal; }
.rc-msg li { padding: 3px 0; color: var(--ink, #EDEDED); }
.rc-fine { font-size: 12px; color: var(--ink-muted, #888); }
.rc-err { border-left-color: #ff5a5a; color: #ff9a9a; }
.rc-links { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 6px 14px; padding-left: 2px; }
.rc-links a { font-family: var(--font-mono, monospace); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent, #00FF00); text-decoration: none; }
.rc-links a::after { content: " →"; }
.rc-links a:hover { text-decoration: underline; }
.rc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-chips button {
  font-family: var(--font-mono, monospace); font-size: 11px; letter-spacing: 0.04em; padding: 8px 10px;
  border: 1px solid var(--border-strong, #333); background: rgba(20, 20, 20, 0.6); color: var(--ink, #EDEDED); cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.rc-chips button:hover, .rc-chips button:focus-visible { border-color: var(--accent, #00FF00); color: var(--accent, #00FF00); outline: none; }

.rc-form { display: flex; border-top: 1px solid var(--border, #262626); }
.rc-input {
  flex: 1; min-width: 0; padding: 14px 16px; background: transparent; border: 0; border-radius: 0;
  color: var(--ink, #EDEDED); font: 500 14px var(--font-display, sans-serif);
}
.rc-input::placeholder { color: var(--ink-muted, #888); }
.rc-input:focus { outline: none; background: rgba(255, 255, 255, 0.02); }
.rc-send { flex: none; padding: 0 18px; background: var(--accent, #00FF00); color: var(--ink-inverse, #0A0A0A); border: 0; font: 700 13px var(--font-display, sans-serif); cursor: pointer; }
.rc-send:hover { background: var(--ink, #EDEDED); }

/* OnPost page: its floating walkthrough button moves left of the chat button */
.float-cta { right: 88px; }

@media (max-width: 560px) {
  .rmfc-chat { right: 16px; bottom: calc(16px + var(--rc-lift)); }
  .rc-btn { height: 52px; padding: 0 14px; }
  .rc-btn-txt { display: none; }
  .rc-panel { position: fixed; inset: 0; width: auto; height: auto; border: 0; z-index: 80; }
  .rc-input { font-size: 16px; } /* no zoom on focus in iOS Safari */
  .float-cta { right: 84px; }
}
@media (prefers-reduced-motion: no-preference) {
  .rc-panel:not([hidden]) { animation: rcIn 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
  @keyframes rcIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}
