/* ═══════════════════════════════════════════════════════════════
   XODE — THE AGENT PANEL  (src/agent.js)
   A drawer on the right of the editor, in the editor's own dark
   colours, with violet for actions and lime for "done".
   ═══════════════════════════════════════════════════════════════ */

.xa-btn {
  width: auto !important;
  gap: 6px;
  padding: 0 11px !important;
  display: inline-flex;
  align-items: center;
  font: 700 11.5px/1 var(--font-body, Inter, sans-serif);
}
.xa-btn svg { width: 15px; height: 15px; }
/* Lime, so it is never mistaken for the AI button beside it — that one
   connects your own AI account; this is XODE's agent. */
.editor-topbar .xa-btn,
.xa-btn {
  height: 30px;
  margin: 0 4px;
  border-radius: 100px;
  background: #C9F26B;
  color: #0B0B0F;
}
.editor-topbar .xa-btn:hover:not(:disabled),
.xa-btn:hover { background: #D7F78C; color: #0B0B0F; }
.xa-btn.is-open { box-shadow: 0 0 0 2px rgba(201, 242, 107, .35); }

.xa {
  position: fixed;
  top: 60px;
  right: 12px;
  /* Clear of the bottom bar (56px, zoom and pages) — it stays usable
     with the panel open. */
  bottom: 68px;
  max-height: calc(100vh - 128px);
  z-index: 9550;              /* above the assistant's chat button */
  width: min(400px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-2, #383B46);
  border-radius: 16px;
  background: var(--bg-2, #16161C);
  color: var(--text-1, #E7E7EA);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  font: 13px/1.5 var(--font-body, Inter, sans-serif);
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  pointer-events: none;
  transition: transform .4s cubic-bezier(.16, 1, .3, 1), opacity .25s;
}
.xa.open { transform: none; opacity: 1; pointer-events: auto; }

.xa-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 10px 16px;
}
.xa-head b { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text-0, #fff); }
.xa-head b svg { width: 17px; height: 17px; color: #C9F26B; }
.xa-left { margin-left: auto; font-size: 11px; color: var(--text-3, #8B8D98); white-space: nowrap; }
.xa-x {
  width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2, #C9CBD4); cursor: pointer;
}
.xa-x:hover { background: var(--bg-3, #22242C); color: #fff; }

.xa-tabs {
  display: flex;
  gap: 4px;
  margin: 0 14px 10px;
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-1, #101015);
}
.xa-tabs button {
  flex: 1;
  padding: 8px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-3, #8B8D98);
  font: 700 12px/1 inherit;
  font-family: inherit;
  cursor: pointer;
}
.xa-tabs button.on { background: var(--bg-3, #22242C); color: #fff; }

.xa-pane { display: none; flex: 1; min-height: 0; overflow-y: auto; padding: 2px 14px 16px; }
.xa-pane.on { display: flex; flex-direction: column; gap: 10px; }

.xa-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 14px;
  border: 1.5px dashed var(--border-2, #383B46);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.xa-drop:hover, .xa-drop.is-over { border-color: #7C5CFF; background: rgba(124, 92, 255, .08); }
.xa-drop b { color: var(--text-0, #fff); font-size: 13.5px; }
.xa-drop span { color: var(--text-3, #8B8D98); font-size: 11.5px; }
.xa-drop em { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: normal; color: #C9F26B; font-size: 12px; font-weight: 600; }
.xa-drop em:empty { display: none; }

.xa-text {
  width: 100%;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--border-2, #383B46);
  border-radius: 10px;
  background: var(--bg-1, #101015);
  color: var(--text-0, #fff);
  font: inherit;
}
.xa-text:focus { outline: none; border-color: #7C5CFF; }
.xa-check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2, #C9CBD4); }

.xa-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 14px;
  border: 1px solid #7C5CFF;
  border-radius: 10px;
  background: #7C5CFF;
  color: #fff;
  font: 700 13px/1 inherit;
  font-family: inherit;
  cursor: pointer;
}
.xa-go:hover { background: #8C6FFF; }
.xa-go svg { width: 15px; height: 15px; }
.xa-go.sm, .xa-ghost.sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.xa-ghost {
  padding: 10px 14px;
  border: 1px solid var(--border-2, #383B46);
  border-radius: 10px;
  background: transparent;
  color: var(--text-1, #E7E7EA);
  font: 600 13px/1 inherit;
  font-family: inherit;
  cursor: pointer;
}
.xa-ghost:hover { background: var(--bg-3, #22242C); }
.xa-link { margin-left: auto; border: 0; background: none; color: #B6A4FF; font: 700 12px/1 inherit; font-family: inherit; cursor: pointer; }
.xa-row { display: flex; gap: 8px; align-items: center; }

.xa-note, .xa-lead { margin: 0; font-size: 11.5px; color: var(--text-3, #8B8D98); }
.xa-lead { font-size: 12.5px; color: var(--text-2, #C9CBD4); }
.xa-note a { color: #B6A4FF; }

.xa-out:empty { display: none; }
.xa-out { display: flex; flex-direction: column; gap: 10px; }
.xa-msg { display: block; padding: 10px 12px; border-radius: 10px; background: var(--bg-1, #101015); color: var(--text-1, #E7E7EA); }
.xa-msg.ok { box-shadow: inset 3px 0 0 #C9F26B; }
.xa-msg.warn { box-shadow: inset 3px 0 0 #FFB454; }
.xa-msg.bad { box-shadow: inset 3px 0 0 #FF6B6B; }
.xa-msg a { color: #B6A4FF; }

.xa-work { display: flex; align-items: center; gap: 5px; padding: 10px 12px; color: var(--text-2, #C9CBD4); }
.xa-work i { width: 6px; height: 6px; border-radius: 50%; background: #7C5CFF; animation: xa-dot 1s ease-in-out infinite; }
.xa-work i:nth-child(2) { animation-delay: .15s; background: #9D85FF; }
.xa-work i:nth-child(3) { animation-delay: .3s; background: #C9F26B; }
.xa-work span { margin-left: 6px; }
@keyframes xa-dot { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-4px); opacity: 1; } }

.xa-sum { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2, #C9CBD4); }
.xa-sum b { color: var(--text-0, #fff); }

.xa-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.xa-list label { display: grid; grid-template-columns: 16px 1fr; gap: 2px 8px; padding: 8px 10px; border-radius: 9px; background: var(--bg-1, #101015); cursor: pointer; }
.xa-list input { grid-row: 1 / span 2; margin-top: 3px; accent-color: #7C5CFF; }
.xa-list s { color: var(--text-3, #8B8D98); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xa-list span { color: var(--text-0, #fff); font-size: 12.5px; white-space: pre-line; }

.xa-card {
  padding: 11px 12px;
  border: 1px solid var(--border-1, #2A2A34);
  border-radius: 12px;
  background: var(--bg-1, #101015);
  transition: border-color .15s, opacity .2s;
}
.xa-card:hover { border-color: #7C5CFF; }
.xa-card.is-accepted, .xa-card.is-ignored { opacity: .55; }
.xa-kind { display: inline-block; padding: 3px 8px; border-radius: 100px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: rgba(124, 92, 255, .16); color: #B6A4FF; }
.xa-kind.k-quantify { background: rgba(201, 242, 107, .14); color: #C9F26B; }
.xa-kind.k-grammar { background: rgba(255, 180, 84, .14); color: #FFB454; }
.xa-ctx { margin: 8px 0 4px; color: var(--text-2, #C9CBD4); font-size: 12.5px; }
.xa-ctx s { color: #FF8A8A; text-decoration-thickness: 1.5px; }
.xa-ctx ins { margin-left: 4px; padding: 0 3px; border-radius: 4px; text-decoration: none; background: rgba(201, 242, 107, .16); color: #E2F9A8; }
.xa-why { margin: 0 0 9px; font-size: 11.5px; color: var(--text-3, #8B8D98); }
.xa-done { margin: 0; font-size: 11.5px; font-weight: 700; color: #C9F26B; }

@media (prefers-reduced-motion: reduce) {
  .xa { transition: none; }
  .xa-work i { animation: none; }
}
