/* CSA-in-a-Box Copilot Chat Widget */

/* ── Floating Button ───────────────────────────────────── */
.copilot-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #0078d4;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  transition: transform .2s, box-shadow .2s;
}
.copilot-fab:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.copilot-fab svg { width: 28px; height: 28px; fill: currentColor; }

/* ── Panel ─────────────────────────────────────────────── */
.copilot-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 400px;
  height: 520px;
  min-width: 300px;
  min-height: 280px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1.5px solid rgba(0,120,212,.35);
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  z-index: 9999;
  overflow: hidden;
  transition: opacity .25s ease, transform .25s ease;
}
.copilot-panel.copilot-resizing { transition: none; }

/* ── Resize Handle (top-left corner) ───────────────────── */
.copilot-resize {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  z-index: 10001;
  background: transparent;
  border-top-left-radius: 16px;
}
.copilot-resize::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 8px;
  height: 8px;
  border-top: 2px solid rgba(0,0,0,.25);
  border-left: 2px solid rgba(0,0,0,.25);
  border-radius: 2px 0 0 0;
}
.copilot-resize:hover::after {
  border-color: rgba(0,0,0,.5);
}
.copilot-hidden { opacity: 0; pointer-events: none; transform: translateY(16px); }
.copilot-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ── Header ────────────────────────────────────────────── */
.copilot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #0078d4;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}
.copilot-header-actions { display: flex; gap: 6px; }
.copilot-header-actions button {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1;
  opacity: .8;
}
.copilot-header-actions button:hover { opacity: 1; background: rgba(255,255,255,.15); }

/* ── Messages ──────────────────────────────────────────── */
.copilot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.copilot-msg { display: flex; gap: 8px; max-width: 90%; }
.copilot-msg-user { align-self: flex-end; flex-direction: row-reverse; }
.copilot-msg-assistant { align-self: flex-start; }

.copilot-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.copilot-msg-assistant .copilot-avatar { background: #e8eaed; }
.copilot-msg-user .copilot-avatar { background: #0078d4; color: #fff; }

.copilot-bubble {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}
.copilot-msg-assistant .copilot-bubble { background: #f1f3f4; color: #1a1a1a; }
.copilot-msg-user .copilot-bubble { background: #0078d4; color: #fff; }

/* ── Typography inside bubbles ─────────────────────────── */
.copilot-bubble code {
  font-family: "Cascadia Code", "Fira Code", monospace;
  font-size: 12px;
  background: rgba(0,0,0,.06);
  padding: 1px 4px;
  border-radius: 3px;
}
.copilot-bubble pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 10px 12px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 6px 0;
  font-size: 12px;
}
.copilot-bubble pre code { background: transparent; padding: 0; color: inherit; }
.copilot-bubble a { color: #0078d4; text-decoration: underline; }
.copilot-bubble ul, .copilot-bubble ol { margin: 4px 0; padding-left: 18px; }
.copilot-bubble ol { list-style: decimal; }
.copilot-bubble p { margin: 4px 0; }
.copilot-bubble h1, .copilot-bubble h2, .copilot-bubble h3, .copilot-bubble h4 {
  margin: 10px 0 4px;
  line-height: 1.3;
  font-weight: 600;
}
.copilot-bubble h1 { font-size: 16px; }
.copilot-bubble h2 { font-size: 15px; }
.copilot-bubble h3 { font-size: 14px; }
.copilot-bubble h4 { font-size: 13.5px; }
.copilot-bubble hr {
  border: none;
  border-top: 1px solid rgba(0,0,0,.12);
  margin: 8px 0;
}

/* ── References Card ──────────────────────────────────── */
.copilot-refs-bubble {
  padding: 6px 10px !important;
}
.copilot-refs-header {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
  letter-spacing: .3px;
}
.copilot-ref-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.copilot-ref-item:last-child { border-bottom: none; }
.copilot-ref-page {
  flex: 1;
  font-size: 12.5px;
  color: #0078d4;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copilot-ref-page:hover { text-decoration: underline; }
.copilot-ref-gh {
  flex-shrink: 0;
  color: #666;
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 3px;
  transition: color .15s;
}
.copilot-ref-gh:hover { color: #1a1a1a; }

/* ── Input Area ────────────────────────────────────────── */
.copilot-input-area {
  display: flex;
  align-items: flex-end;
  padding: 10px 12px;
  border-top: 1px solid #e0e0e0;
  gap: 8px;
  flex-shrink: 0;
}
.copilot-input {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13.5px;
  resize: none;
  max-height: 100px;
  outline: none;
  font-family: inherit;
  line-height: 1.4;
  background: #fff;
  color: #1a1a1a;
}
.copilot-input:focus { border-color: #0078d4; }
.copilot-send {
  background: #0078d4;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.copilot-send:disabled { opacity: .5; cursor: not-allowed; }

/* ── Typing Cursor ─────────────────────────────────────── */
.copilot-typing::after {
  content: "\2588";
  animation: copilot-blink 1s step-end infinite;
}
@keyframes copilot-blink { 50% { opacity: 0; } }

/* ══════════════════════════════════════════════════════════
   Dark Mode — MkDocs Material [data-md-color-scheme="slate"]
   ══════════════════════════════════════════════════════════ */
[data-md-color-scheme="slate"] .copilot-panel { background: #1e1e1e; border-color: rgba(77,166,255,.3); }
[data-md-color-scheme="slate"] .copilot-resize::after { border-color: rgba(255,255,255,.25); }
[data-md-color-scheme="slate"] .copilot-resize:hover::after { border-color: rgba(255,255,255,.5); }
[data-md-color-scheme="slate"] .copilot-msg-assistant .copilot-bubble { background: #2d2d2d; color: #e0e0e0; }
[data-md-color-scheme="slate"] .copilot-msg-assistant .copilot-avatar { background: #383838; }
[data-md-color-scheme="slate"] .copilot-input { background: #2a2a2a; color: #e0e0e0; border-color: #444; }
[data-md-color-scheme="slate"] .copilot-input-area { border-top-color: #333; }
[data-md-color-scheme="slate"] .copilot-bubble code { background: rgba(255,255,255,.08); }
[data-md-color-scheme="slate"] .copilot-bubble a { color: #4da6ff; }
[data-md-color-scheme="slate"] .copilot-bubble hr { border-top-color: rgba(255,255,255,.15); }
/* References card — dark */
[data-md-color-scheme="slate"] .copilot-refs-header { color: #999; }
[data-md-color-scheme="slate"] .copilot-ref-item { border-bottom-color: rgba(255,255,255,.06); }
[data-md-color-scheme="slate"] .copilot-ref-page { color: #4da6ff; }
[data-md-color-scheme="slate"] .copilot-ref-gh { color: #888; }
[data-md-color-scheme="slate"] .copilot-ref-gh:hover { color: #ccc; }

/* ══════════════════════════════════════════════════════════
   Dark Mode — Browser prefers-color-scheme (fallback)
   Applies when user has dark OS/browser setting but MkDocs
   scheme attribute is not set (e.g., embedded or standalone)
   ══════════════════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
  :root:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-panel,
  body:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-panel {
    background: #1e1e1e;
  }
  :root:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-msg-assistant .copilot-bubble,
  body:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-msg-assistant .copilot-bubble {
    background: #2d2d2d; color: #e0e0e0;
  }
  :root:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-msg-assistant .copilot-avatar,
  body:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-msg-assistant .copilot-avatar {
    background: #383838;
  }
  :root:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-input,
  body:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-input {
    background: #2a2a2a; color: #e0e0e0; border-color: #444;
  }
  :root:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-input-area,
  body:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-input-area {
    border-top-color: #333;
  }
  :root:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-bubble code,
  body:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-bubble code {
    background: rgba(255,255,255,.08);
  }
  :root:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-bubble a,
  body:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-bubble a {
    color: #4da6ff;
  }
  :root:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-refs-header,
  body:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-refs-header {
    color: #999;
  }
  :root:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-ref-page,
  body:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-ref-page {
    color: #4da6ff;
  }
  :root:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-ref-gh,
  body:not([data-md-color-scheme="default"]):not([data-md-color-scheme]) .copilot-ref-gh {
    color: #888;
  }
}

/* ── Full-Page Mode ────────────────────────────────────── */
.copilot-fullpage-mode .copilot-fab { display: none; }
.copilot-fullpage-mode .copilot-panel {
  position: relative;
  bottom: auto;
  right: auto;
  width: 100%;
  max-height: none;
  border-radius: 12px;
  border: 1.5px solid rgba(0,120,212,.35);
  box-shadow: 0 2px 12px rgba(0,0,0,.1);
}
#copilot-fullpage {
  min-height: 500px;
}
.copilot-fullpage-mode .copilot-messages {
  height: calc(100vh - 340px);
  min-height: 400px;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 600px) {
  .copilot-panel {
    width: calc(100vw - 16px);
    right: 8px;
    bottom: 80px;
    height: calc(100vh - 120px);
    max-height: calc(100vh - 120px);
  }
  .copilot-resize { display: none; }
}

/* ── Custom Scrollbar ──────────────────────────────────── */
.copilot-messages::-webkit-scrollbar { width: 6px; }
.copilot-messages::-webkit-scrollbar-track { background: transparent; }
.copilot-messages::-webkit-scrollbar-thumb { background: #c0c0c0; border-radius: 3px; }
[data-md-color-scheme="slate"] .copilot-messages::-webkit-scrollbar-thumb { background: #555; }

/* ── Markdown table inside a chat bubble ───────────────── */
.copilot-bubble .copilot-table-wrap {
  overflow-x: auto;
  margin: 0.5rem 0;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
[data-md-color-scheme="slate"] .copilot-bubble .copilot-table-wrap {
  border-color: rgba(255, 255, 255, 0.12);
}
.copilot-bubble .copilot-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.85em;
}
.copilot-bubble .copilot-table th,
.copilot-bubble .copilot-table td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  vertical-align: top;
}
.copilot-bubble .copilot-table th {
  background: rgba(0, 120, 212, 0.08);
  font-weight: 600;
  text-align: left;
}
[data-md-color-scheme="slate"] .copilot-bubble .copilot-table th {
  background: rgba(96, 168, 255, 0.12);
}
[data-md-color-scheme="slate"] .copilot-bubble .copilot-table th,
[data-md-color-scheme="slate"] .copilot-bubble .copilot-table td {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.copilot-bubble .copilot-table tr:last-child td { border-bottom: 0; }

/* ── Task lists ────────────────────────────────────────── */
.copilot-bubble .copilot-task-list {
  list-style: none;
  padding-left: 0.25rem;
  margin: 0.25rem 0;
}
.copilot-bubble .copilot-task {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0.15rem 0;
}
.copilot-bubble .copilot-task input[type="checkbox"] {
  margin-top: 0.25rem;
  accent-color: #0078d4;
}

/* ── Blockquote ────────────────────────────────────────── */
.copilot-bubble .copilot-quote {
  margin: 0.5rem 0;
  padding: 0.4rem 0.75rem;
  border-left: 3px solid #0078d4;
  background: rgba(0, 120, 212, 0.06);
  font-style: italic;
}
[data-md-color-scheme="slate"] .copilot-bubble .copilot-quote {
  background: rgba(96, 168, 255, 0.08);
  border-left-color: #60a8ff;
}

/* ── Code block — copy button + relative positioning ──── */
.copilot-bubble pre {
  position: relative;
  margin: 0.5rem 0;
  padding: 0.6rem 0.7rem;
  padding-right: 2.4rem;
  background: #f6f8fa;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85em;
  line-height: 1.45;
}
[data-md-color-scheme="slate"] .copilot-bubble pre {
  background: #1e2230;
}
.copilot-bubble pre code {
  background: transparent;
  padding: 0;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
.copilot-bubble .copilot-copy {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 24px;
  padding: 0;
  font-size: 13px;
  line-height: 22px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, transform 0.1s;
}
.copilot-bubble pre:hover .copilot-copy,
.copilot-bubble pre:focus-within .copilot-copy {
  opacity: 1;
}
.copilot-bubble .copilot-copy:hover { background: #fff; transform: translateY(-1px); }
.copilot-bubble .copilot-copy.copilot-copied {
  background: #d4f4dd;
  border-color: #2ea043;
  color: #1a5d2b;
  opacity: 1;
}
[data-md-color-scheme="slate"] .copilot-bubble .copilot-copy {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.15);
  color: #e6e6e6;
}
[data-md-color-scheme="slate"] .copilot-bubble .copilot-copy:hover {
  background: rgba(0, 0, 0, 0.6);
}
[data-md-color-scheme="slate"] .copilot-bubble .copilot-copy.copilot-copied {
  background: #1a5d2b;
  border-color: #2ea043;
  color: #d4f4dd;
}

/* ── Inline citation superscript ───────────────────────── */
.copilot-bubble .copilot-cite {
  font-size: 0.7em;
  margin: 0 1px;
}
.copilot-bubble .copilot-cite a {
  color: #0078d4;
  text-decoration: none;
  padding: 0 3px;
  border-radius: 3px;
  background: rgba(0, 120, 212, 0.1);
}
.copilot-bubble .copilot-cite a:hover {
  background: rgba(0, 120, 212, 0.2);
}
[data-md-color-scheme="slate"] .copilot-bubble .copilot-cite a {
  color: #60a8ff;
  background: rgba(96, 168, 255, 0.15);
}

/* ── Citations footer card (AI-curated sources) ───────── */
.copilot-bubble.copilot-citations-bubble {
  background: linear-gradient(180deg, rgba(0, 120, 212, 0.04), rgba(0, 120, 212, 0.02));
  border: 1px solid rgba(0, 120, 212, 0.18);
}
[data-md-color-scheme="slate"] .copilot-bubble.copilot-citations-bubble {
  background: linear-gradient(180deg, rgba(96, 168, 255, 0.06), rgba(96, 168, 255, 0.02));
  border-color: rgba(96, 168, 255, 0.22);
}
.copilot-citations-header {
  font-weight: 600;
  font-size: 0.85em;
  margin-bottom: 0.4rem;
  color: #0078d4;
}
[data-md-color-scheme="slate"] .copilot-citations-header { color: #60a8ff; }
.copilot-citations-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.85em;
}
.copilot-citations-list li { margin: 0.15rem 0; }
.copilot-citations-list a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}
.copilot-citations-list a:hover { border-bottom-style: solid; }

/* ── Streaming caret (typing indicator while bytes arrive) */
.copilot-bubble.copilot-typing::after {
  content: "▍";
  display: inline-block;
  animation: copilotBlink 1s steps(2) infinite;
  margin-left: 2px;
  color: #0078d4;
}
@keyframes copilotBlink {
  to { opacity: 0; }
}

/* ══════════════════════════════════════════════════════════
   Privacy banner (first-open opt-in)
   ══════════════════════════════════════════════════════════ */
.copilot-banner {
  flex-shrink: 0;
  padding: 10px 14px;
  background: rgba(0, 120, 212, 0.08);
  border-bottom: 1px solid rgba(0, 120, 212, 0.2);
  font-size: 12.5px;
  line-height: 1.4;
  color: #1a1a1a;
}
.copilot-banner-text { margin-bottom: 6px; }
.copilot-banner-text a { color: #0078d4; }
.copilot-banner-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.copilot-banner-actions button {
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.copilot-banner-accept {
  background: #0078d4 !important;
  color: #fff !important;
  border-color: #0078d4 !important;
}
.copilot-banner-out:hover { background: #f1f3f4; }
.copilot-banner-accept:hover { background: #006bbe !important; }
[data-md-color-scheme="slate"] .copilot-banner {
  background: rgba(96, 168, 255, 0.10);
  border-bottom-color: rgba(96, 168, 255, 0.25);
  color: #e0e0e0;
}
[data-md-color-scheme="slate"] .copilot-banner-actions button {
  background: #2a2a2a;
  color: #e0e0e0;
  border-color: rgba(255, 255, 255, 0.2);
}
[data-md-color-scheme="slate"] .copilot-banner-out:hover { background: #383838; }
[data-md-color-scheme="slate"] .copilot-banner-text a { color: #4da6ff; }

/* ══════════════════════════════════════════════════════════
   Feedback strip (👍 / 👎 under each assistant reply)
   ══════════════════════════════════════════════════════════ */
.copilot-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 4px 36px;
  padding: 4px 8px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.55);
}
.copilot-feedback-label { user-select: none; }
.copilot-thumb {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 14px;
  padding: 1px 8px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}
.copilot-thumb:hover {
  background: rgba(0, 120, 212, 0.08);
  border-color: rgba(0, 120, 212, 0.5);
  transform: translateY(-1px);
}
.copilot-thumb:active { transform: translateY(0); }
.copilot-thumb:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}
.copilot-feedback-locked .copilot-thumb:hover { background: transparent; }
.copilot-feedback-pill {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(46, 160, 67, 0.12);
  color: #1a5d2b;
  font-weight: 500;
}
[data-md-color-scheme="slate"] .copilot-feedback { color: rgba(255, 255, 255, 0.55); }
[data-md-color-scheme="slate"] .copilot-thumb {
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
}
[data-md-color-scheme="slate"] .copilot-thumb:hover {
  background: rgba(96, 168, 255, 0.15);
  border-color: rgba(96, 168, 255, 0.5);
}
[data-md-color-scheme="slate"] .copilot-feedback-pill {
  background: rgba(46, 160, 67, 0.2);
  color: #6ad188;
}

/* ══════════════════════════════════════════════════════════
   Uncovered-question prompt
   ══════════════════════════════════════════════════════════ */
.copilot-uncovered {
  margin: 4px 8px 4px 36px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 200, 0, 0.10);
  border: 1px dashed rgba(180, 130, 0, 0.4);
  font-size: 13px;
  color: #4a3a00;
}
.copilot-uncovered-text { margin-bottom: 6px; }
.copilot-uncovered-actions { display: flex; gap: 6px; }
.copilot-uncovered-actions button {
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.copilot-uncovered-add {
  background: #0078d4 !important;
  color: #fff !important;
  border-color: #0078d4 !important;
}
.copilot-uncovered-add:hover { background: #006bbe !important; }
.copilot-uncovered-skip:hover { background: #f1f3f4; }
.copilot-uncovered-thanks {
  font-style: italic;
  color: rgba(0, 0, 0, 0.6);
}
[data-md-color-scheme="slate"] .copilot-uncovered {
  background: rgba(255, 200, 0, 0.08);
  border-color: rgba(255, 200, 0, 0.3);
  color: #ffd770;
}
[data-md-color-scheme="slate"] .copilot-uncovered-actions button {
  background: #2a2a2a;
  color: #e0e0e0;
  border-color: rgba(255, 255, 255, 0.2);
}
[data-md-color-scheme="slate"] .copilot-uncovered-skip:hover { background: #383838; }
[data-md-color-scheme="slate"] .copilot-uncovered-thanks {
  color: rgba(255, 255, 255, 0.55);
}

/* ══════════════════════════════════════════════════════════
   Modal (improvement / use-case-request)
   ══════════════════════════════════════════════════════════ */
.copilot-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10100;
  padding: 16px;
}
.copilot-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.copilot-modal-header {
  padding: 14px 18px;
  background: #0078d4;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}
.copilot-modal-body {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.copilot-modal-help {
  margin: 0;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.6);
}
.copilot-modal-help.copilot-modal-error { color: #b91c1c; }
.copilot-modal-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 6px;
}
.copilot-modal-tab {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 12.5px;
}
.copilot-modal-tab-active {
  background: #0078d4;
  color: #fff;
  border-color: #0078d4;
}
.copilot-modal-input,
.copilot-modal-textarea {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  background: #fff;
  color: #1a1a1a;
}
.copilot-modal-input { height: 36px; }
.copilot-modal-textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.4;
}
.copilot-modal-input:focus,
.copilot-modal-textarea:focus { border-color: #0078d4; }
.copilot-modal-input.copilot-modal-error,
.copilot-modal-textarea.copilot-modal-error { border-color: #b91c1c; }
.copilot-modal-actions {
  padding: 10px 18px 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.copilot-modal-primary,
.copilot-modal-secondary {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.copilot-modal-primary {
  background: #0078d4;
  color: #fff;
  border-color: #0078d4;
}
.copilot-modal-primary:hover { background: #006bbe; }
.copilot-modal-secondary:hover { background: #f1f3f4; }
[data-md-color-scheme="slate"] .copilot-modal {
  background: #1e1e1e;
  color: #e0e0e0;
}
[data-md-color-scheme="slate"] .copilot-modal-help { color: rgba(255, 255, 255, 0.55); }
[data-md-color-scheme="slate"] .copilot-modal-help.copilot-modal-error { color: #ff8080; }
[data-md-color-scheme="slate"] .copilot-modal-input,
[data-md-color-scheme="slate"] .copilot-modal-textarea {
  background: #2a2a2a;
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
}
[data-md-color-scheme="slate"] .copilot-modal-tab {
  border-color: rgba(255, 255, 255, 0.15);
  color: #e0e0e0;
  background: transparent;
}
[data-md-color-scheme="slate"] .copilot-modal-secondary {
  background: #2a2a2a;
  color: #e0e0e0;
  border-color: rgba(255, 255, 255, 0.2);
}
[data-md-color-scheme="slate"] .copilot-modal-secondary:hover { background: #383838; }

/* ══════════════════════════════════════════════════════════
   Request-button (header)
   ══════════════════════════════════════════════════════════ */
.copilot-request {
  font-size: 14px !important;
}

/* ══════════════════════════════════════════════════════════
   Inline system messages (opt-out confirmation, etc.)
   ══════════════════════════════════════════════════════════ */
.copilot-msg.copilot-system .copilot-bubble {
  background: rgba(46, 160, 67, 0.10) !important;
  border: 1px solid rgba(46, 160, 67, 0.3);
  color: #1a5d2b;
}
[data-md-color-scheme="slate"] .copilot-msg.copilot-system .copilot-bubble {
  background: rgba(46, 160, 67, 0.15) !important;
  border-color: rgba(46, 160, 67, 0.35);
  color: #6ad188;
}
