/* core/donna-companion.css — app-wide Donna companion (dock peek + chatbox).
 *
 * The character SVG + roam styles live in dashboard.css (.uno-*). This file adds only
 * the app-wide companion surfaces: her docked right-edge peek and (Phase 3) the
 * floating mini-chat box.
 */

/* ── Docked right-edge peek ──────────────────────────────────────────────────
   In dock mode she is tucked against the right edge of the viewport. The figure is
   the drag handle (grab cursor); a plain click opens the chatbox. A soft shadow +
   hover nudge make her feel like a tab you can pull. */
.uno-actor[data-mode="dock"] { z-index: 61; }
.uno-actor[data-mode="dock"] .uno-figure {
  cursor: grab;
  filter: drop-shadow(-6px 8px 14px rgba(0, 0, 0, .28));
  touch-action: none;                 /* let the pointer drag own vertical movement */
}
.uno-actor[data-mode="dock"] .uno-figure:active { cursor: grabbing; }

/* A faint "grip" halo so she reads as interactive against busy routes. */
.uno-actor[data-mode="dock"]::after {
  content: "";
  position: absolute; inset: -6px -2px -6px -10px;
  border-radius: 18px;
  background: radial-gradient(60% 60% at 30% 50%, color-mix(in srgb, var(--uno-primary, #7c5cff) 22%, transparent), transparent 72%);
  opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.uno-actor[data-mode="dock"]:hover::after { opacity: 1; }

/* Roam mode never shows the dock chrome. */
.uno-actor[data-mode="roam"]::after { content: none; }

/* During a guided tour she must sit ABOVE the tutorial dim mask (z 99990+) so the
   user can see her pointing at the highlighted target. */
.uno-actor.uno-tour { z-index: 100000; }

/* "Thinking" — a soft pulse while a turn streams so she visibly works. */
.uno-actor.uno-thinking .uno-figure { animation: unoThink 1.1s ease-in-out infinite; }
@keyframes unoThink {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 0 transparent); }
  50% { filter: brightness(1.12) drop-shadow(0 0 10px color-mix(in srgb, var(--uno-primary, #7c5cff) 60%, transparent)); }
}
@media (prefers-reduced-motion: reduce) {
  .uno-actor.uno-thinking .uno-figure { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .uno-actor[data-mode="dock"]::after { transition: none; }
}

/* ── Floating mini-chat (donna/companion/chatbox.js) ─────────────────────────── */
.dcx {
  position: fixed;
  right: 78px;
  bottom: 24px;
  z-index: 62;
  width: min(370px, calc(100vw - 32px));
  max-height: min(72vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--surface), var(--btrans);
  backdrop-filter: blur(10px) brightness(0.5);
  border: var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .42), 0 2px 8px rgba(0, 0, 0, .3);
  overflow: hidden;
  transform: translateY(12px) scale(.98);
  opacity: 0;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), opacity .2s ease;
}
.dcx.is-open { transform: none; opacity: 1; }

.dcx-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line, rgba(255, 255, 255, .08)); }
.dcx-avatar {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--uno-light, #a999ff), var(--uno-primary, #7c5cff));
  color: #fff; font-size: 15px;
}
.dcx-head-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.dcx-title { font-weight: 600; font-size: 14px; }
.dcx-sub { font-size: 11px; opacity: .6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcx-close { margin-left: auto; background: none; border: 0; color: inherit; font-size: 22px; line-height: 1; opacity: .6; cursor: pointer; padding: 0 4px; }
.dcx-close:hover { opacity: 1; }

.dcx-body { flex: 1 1 auto; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.dcx-row { display: flex; }
.dcx-row--user { justify-content: flex-end; }
.dcx-row--donna { justify-content: flex-start; }
.dcx-bubble { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; word-wrap: break-word; }
.dcx-bubble--user { background: var(--primary, #7c5cff); color: #fff; border-bottom-right-radius: 5px; white-space: pre-wrap; }
.dcx-bubble--donna { background: color-mix(in srgb, var(--text, #e6e9ef) 8%, transparent); border-bottom-left-radius: 5px; }
.dcx-bubble--donna p:first-child { margin-top: 0; }
.dcx-bubble--donna p:last-child { margin-bottom: 0; }
.dcx-muted { opacity: .6; }
.dcx-error { color: var(--danger, #ff6b6b); }

.dcx-steps { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; font-size: 12px; opacity: .85; }
.dcx-step { display: flex; align-items: baseline; gap: 6px; }
.dcx-step-mark { opacity: .8; }
.dcx-step--active .dcx-step-mark { color: var(--primary, #7c5cff); }
.dcx-step--error .dcx-step-mark { color: var(--danger, #ff6b6b); }
.dcx-step-line { width: 100%; padding-left: 18px; opacity: .7; }

.dcx-thoughts { margin-bottom: 8px; }
.dcx-thoughts-toggle { background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; font-size: 12px; padding: 0; display: inline-flex; align-items: center; gap: 5px; }
.dcx-thoughts-body { margin-top: 6px; font-size: 12px; opacity: .7; white-space: pre-wrap; max-height: 160px; overflow-y: auto; }

.dcx-prompt { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line, rgba(255, 255, 255, .12)); }
.dcx-prompt-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.dcx-prompt-msg { font-size: 12.5px; opacity: .8; margin-bottom: 8px; }
.dcx-prompt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dcx-pbtn { border: 1px solid var(--line, rgba(255, 255, 255, .16)); background: transparent; color: inherit; padding: 6px 12px; border-radius: 8px; font-size: 12.5px; cursor: pointer; }
.dcx-pbtn.primary { background: var(--primary, #7c5cff); border-color: transparent; color: #fff; }

.dcx-bar { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line, rgba(255, 255, 255, .08)); }
.dcx-input { flex: 1 1 auto; resize: none; background: color-mix(in srgb, var(--text, #e6e9ef) 6%, transparent); border: 1px solid var(--line, rgba(255, 255, 255, .1)); border-radius: 12px; color: inherit; padding: 9px 12px; font: inherit; font-size: 13.5px; max-height: 132px; }
.dcx-input:focus { outline: none; border-color: var(--primary, #7c5cff); }
.dcx-send { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 999px; border: 0; background: var(--primary, #7c5cff); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 15px; }
.dcx-send:hover { filter: brightness(1.08); }

@media (max-width: 560px) { .dcx { right: 12px; left: 12px; bottom: 12px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .dcx { transition: opacity .15s ease; transform: none; } }
