/* NOVA — the one panel.
   Built on the board's own tokens so it follows the theme, with a single
   signature of its own: a cyan-violet aura, calm at rest and alive while the
   agent is working. Nothing here animates for decoration — every moving thing
   is bound to a state the person needs to read. */

:root {
  --nova-a: #38E1FF;
  --nova-b: #A86BFF;
  --nova-glow: 0 0 0 1px rgba(56,225,255,.28), 0 18px 60px -18px rgba(56,225,255,.45);
}

/* ── the launcher the person places ──────────────────────────────────── */
.nova-orb {
  position: fixed; right: 26px; bottom: 96px; z-index: 60;
  width: 56px; height: 56px; border-radius: 50%; border: 0; padding: 0;
  cursor: grab; touch-action: none; background: transparent;
  display: grid; place-items: center;
  filter: drop-shadow(0 10px 24px rgba(56,225,255,.30));
  transition: transform .22s cubic-bezier(.34,1.56,.64,1);
}
.nova-orb:active { cursor: grabbing; }
.nova-orb:hover { transform: scale(1.07); }
.nova-orb-core {
  position: relative; z-index: 2; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--nova-a), var(--nova-b));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 6px 18px -6px rgba(0,0,0,.6);
}
.nova-orb-core svg { width: 22px; height: 22px; }
.nova-orb-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid rgba(56,225,255,.55); opacity: 0;
}
/* An orb the person has NOT placed sits in the panel's default corner, so
   opening the panel would bury it. Step it clear — but only while it is still
   where we put it: once they have dragged it somewhere, their placement wins
   and nothing moves it again. */
.nova-orb.on:not(.placed) { transform: translateX(-452px); }
.nova-orb.on:not(.placed):hover { transform: translateX(-452px) scale(1.07); }
[dir="rtl"] .nova-orb.on:not(.placed) { transform: translateX(452px); }
[dir="rtl"] .nova-orb.on:not(.placed):hover { transform: translateX(452px) scale(1.07); }
@media (max-width: 720px) {
  .nova-orb.on:not(.placed), [dir="rtl"] .nova-orb.on:not(.placed) { transform: none; opacity: 0; pointer-events: none; }
}

/* selected reads as a held ring; working reads as a ring that travels */
.nova-orb.on .nova-orb-ring { opacity: 1; inset: -5px; }
.nova-orb.working .nova-orb-ring { opacity: 1; animation: nova-ping 1.5s ease-out infinite; }
.nova-orb.working .nova-orb-core { animation: nova-breathe 1.9s ease-in-out infinite; }
@keyframes nova-ping {
  0%   { inset: 0;     opacity: .85; }
  100% { inset: -18px; opacity: 0; }
}
@keyframes nova-breathe {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 0 0 0 rgba(56,225,255,.55); }
  50%      { box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 0 26px 4px rgba(56,225,255,.45); }
}

/* ── the panel ───────────────────────────────────────────────────────── */
.nova-panel {
  position: fixed; top: 66px; right: 16px; bottom: 16px; width: 430px;
  max-width: calc(100vw - 32px);
  z-index: 59; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 20px; border: 1px solid var(--border);
  background: var(--panel); backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: var(--shadow), var(--nova-glow);
  animation: nova-in .26s cubic-bezier(.2,.9,.3,1);
}
.nova-panel.hidden { display: none; }
.nova-panel.drop { outline: 2px dashed var(--nova-a); outline-offset: -8px; }
@keyframes nova-in {
  from { opacity: 0; transform: translateX(18px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
/* while it works the edge itself travels — the panel is visibly alive */
.nova-panel.working::before {
  content: ''; position: absolute; inset: 0; border-radius: 20px;
  pointer-events: none; z-index: 5; padding: 1.5px;
  background: linear-gradient(115deg, var(--nova-a), transparent 30%,
                              transparent 70%, var(--nova-b));
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#000,#000) content-box, linear-gradient(#000,#000);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: nova-sweep 2.6s linear infinite;
}
@keyframes nova-sweep {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.nova-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px 14px;
  border-bottom: 1px solid var(--border);
}
.nova-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, var(--nova-a), var(--nova-b));
  box-shadow: 0 4px 14px -4px rgba(56,225,255,.7);
}
.nova-mark svg { width: 17px; height: 17px; }
.nova-who { flex: 1; min-width: 0; line-height: 1.25; }
.nova-who b { display: block; font-size: 14px; letter-spacing: .4px; }
.nova-who span {
  display: block; font-size: 11px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nova-ico {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  cursor: pointer; flex: none;
  transition: color .15s, background .15s, border-color .15s;
}
.nova-ico svg { width: 15px; height: 15px; }
.nova-ico:hover { color: var(--text); background: var(--hover); border-color: var(--border); }
.nova-ico[data-act="close"]:hover { color: var(--danger); border-color: rgba(231,76,60,.4); }

/* ── the capability strip ────────────────────────────────────────────── */
.nova-lanes {
  display: flex; gap: 4px; padding: 8px 10px; overflow-x: auto;
  border-bottom: 1px solid var(--border); scrollbar-width: none;
}
.nova-lanes::-webkit-scrollbar { display: none; }
.nova-lane {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 6px 11px; border-radius: 999px; cursor: pointer; font-size: 12.5px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  transition: all .18s;
}
.nova-lane svg { width: 14px; height: 14px; }
.nova-lane:hover { color: var(--text); background: var(--hover); }
.nova-lane.on {
  color: #fff; border-color: rgba(56,225,255,.45);
  background: linear-gradient(135deg, rgba(56,225,255,.22), rgba(168,107,255,.22));
  box-shadow: 0 0 16px -4px rgba(56,225,255,.6);
}

/* ── the conversation ────────────────────────────────────────────────── */
.nova-msgs {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth;
}
.nova-m {
  max-width: 92%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px;
  line-height: 1.75; word-break: break-word; animation: nova-pop .2s ease-out;
}
@keyframes nova-pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }
.nova-m.user {
  align-self: flex-end; color: #fff; border-bottom-right-radius: 5px;
  background: linear-gradient(135deg, var(--nova-a), var(--nova-b));
}
.nova-m.agent {
  align-self: flex-start; background: var(--hover);
  border: 1px solid var(--border); border-bottom-left-radius: 5px;
}
.nova-m.agent h3, .nova-m.agent h4 { margin: 6px 0 4px; font-size: 14px; }
.nova-m.agent ul { margin: 4px 0; padding-inline-start: 18px; }
.nova-m.agent pre {
  background: rgba(0,0,0,.28); padding: 9px 11px; border-radius: 9px;
  overflow-x: auto; font-size: 12px; margin: 6px 0;
}
.nova-m.agent code {
  background: rgba(0,0,0,.22); padding: 1px 5px; border-radius: 5px; font-size: 12px;
}

/* a tool call, as it happens */
.nova-step {
  align-self: flex-start; display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--hover); max-width: 92%;
  animation: nova-pop .2s ease-out;
}
.nova-step b {
  font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nova-step.ok { border-color: rgba(56,225,255,.35); }
.nova-step.bad { border-color: rgba(231,76,60,.45); color: var(--danger); }
.nova-tick { font-size: 11px; color: var(--nova-a); }
.nova-step.bad .nova-tick { color: var(--danger); }
.nova-spin {
  width: 11px; height: 11px; border-radius: 50%; flex: none;
  border: 2px solid rgba(56,225,255,.25); border-top-color: var(--nova-a);
  animation: nova-spin .7s linear infinite;
}
@keyframes nova-spin { to { transform: rotate(360deg); } }

/* ── the live hint: what it is doing, right now ──────────────────────── */
.nova-hint {
  display: flex; align-items: center; gap: 9px; padding: 7px 15px;
  font-size: 12px; color: var(--text); border-top: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(56,225,255,.12), transparent);
  animation: nova-pop .2s ease-out;
}
.nova-hint.hidden { display: none; }
.nova-hint i {
  font-style: normal; opacity: .92; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.nova-pulse {
  width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--nova-a);
  box-shadow: 0 0 10px var(--nova-a); animation: nova-blink 1.25s ease-in-out infinite;
}
@keyframes nova-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(.7); }
}

/* ── welcome & starters ──────────────────────────────────────────────── */
.nova-welcome { text-align: center; padding: 26px 12px; color: var(--muted); }
.nova-halo {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--nova-a), var(--nova-b));
  box-shadow: 0 0 0 8px rgba(56,225,255,.09), 0 0 34px -6px rgba(56,225,255,.8);
  animation: nova-breathe 3.2s ease-in-out infinite;
}
.nova-halo svg { width: 24px; height: 24px; }
.nova-welcome b { display: block; color: var(--text); font-size: 14.5px; margin-bottom: 7px; }
.nova-welcome p { font-size: 12.5px; line-height: 1.75; margin-bottom: 16px; }
.nova-starts { display: flex; flex-direction: column; gap: 7px; }
.nova-start {
  text-align: start; padding: 9px 13px; border-radius: 11px; cursor: pointer;
  font-size: 12.5px; color: var(--text); background: var(--hover);
  border: 1px solid var(--border); transition: all .16s;
}
.nova-start:hover {
  border-color: rgba(56,225,255,.45); transform: translateX(-2px);
  box-shadow: 0 0 18px -8px rgba(56,225,255,.9);
}
[dir="rtl"] .nova-start:hover { transform: translateX(2px); }

/* ── attachments & input ─────────────────────────────────────────────── */
.nova-atts { display: flex; gap: 7px; padding: 8px 14px 0; flex-wrap: wrap; }
.nova-atts.hidden { display: none; }
.nova-att {
  position: relative; width: 46px; height: 46px; border-radius: 9px;
  overflow: hidden; border: 1px solid var(--border);
}
.nova-att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nova-att i {
  position: absolute; top: 0; inset-inline-end: 0; width: 17px; height: 17px;
  display: grid; place-items: center; font-size: 10px; font-style: normal;
  cursor: pointer; background: rgba(0,0,0,.65); color: #fff;
  border-bottom-left-radius: 7px;
}
.nova-input {
  display: flex; align-items: flex-end; gap: 7px; padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
}
.nova-input textarea {
  flex: 1; resize: none; max-height: 160px; padding: 9px 12px; border-radius: 12px;
  font: inherit; font-size: 13.5px; line-height: 1.6; color: var(--text);
  background: var(--hover); border: 1px solid var(--border); outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.nova-input textarea:focus {
  border-color: rgba(56,225,255,.5); box-shadow: 0 0 0 3px rgba(56,225,255,.10);
}
.nova-go {
  width: 34px; height: 34px; flex: none; border: 0; border-radius: 11px;
  cursor: pointer; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--nova-a), var(--nova-b));
  box-shadow: 0 5px 16px -6px rgba(56,225,255,.9);
  transition: transform .16s, filter .16s;
}
.nova-go svg { width: 16px; height: 16px; }
.nova-go:hover { transform: translateY(-1px) scale(1.05); filter: brightness(1.08); }
[dir="rtl"] .nova-go svg { transform: scaleX(-1); }

@media (max-width: 720px) {
  .nova-panel { top: 58px; right: 8px; left: 8px; bottom: 8px; width: auto; }
}
