/* Copilot panel – matches the website's light-mode design tokens.
   This file is loaded after assets/styles.css so the :root variables are
   already defined.  All colours reference the shared variables so the panel
   adapts automatically to light / dark mode switches. */

.copilotToggle {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink);
}

.copilotPanel {
  position: sticky;
  top: 0;
  width: auto;
  height: 100vh;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--glass);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.copilotPanel[hidden] {
  display: none;
}

.copilotHeader {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--glass);
}

.copilotHeader strong {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

.copilotDot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.copilotDot[data-state="listening"] {
  background: var(--success);
  box-shadow: 0 0 12px var(--success);
}

.copilotDot[data-state="thinking"] {
  background: var(--primary-button);
  box-shadow: 0 0 12px var(--primary-button);
}

.copilotDot[data-state="warning"] {
  background: var(--warning);
  box-shadow: 0 0 12px var(--warning);
}

.copilotDot[data-state="error"] {
  background: var(--danger);
  box-shadow: 0 0 12px var(--danger);
}

.copilotWave {
  display: inline-flex;
  align-items: flex-bottom;
  gap: 2px;
  height: 14px;
}

.copilotWave[hidden] {
  display: none;
}

.copilotWave i {
  width: 3px;
  height: 5px;
  border-radius: 999px;
  background: var(--muted);
  animation: copilotWave 900ms ease-in-out infinite;
}

.copilotWave i:nth-child(2) {
  animation-delay: 120ms;
}

.copilotWave i:nth-child(3) {
  animation-delay: 240ms;
}

.copilotStatusGroup {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.copilotStatus {
  color: var(--muted);
  font-size: 11px;
  transition: color 180ms ease;
}

.copilotStatus[data-state="listening"] {
  color: var(--success);
}

.copilotStatus[data-state="thinking"] {
  color: var(--primary-button);
}

.copilotStatus[data-state="warning"] {
  color: var(--warning);
}

.copilotStatus[data-state="error"] {
  color: var(--danger);
}

.copilotHeader button {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.copilotHeader button:hover {
  border-color: var(--accent);
  color: var(--primary-button);
}

.copilotToolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.copilotToolbar button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  color: var(--ink);
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, opacity 180ms ease;
}

.copilotToolbar button:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.18);
}

.copilotToolbar button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.copilotToolbar .secondary {
  border-color: var(--line);
  background: var(--glass);
  color: var(--ink);
}

.copilotToolbar .copilotPrimary {
  border-color: var(--primary-button);
  background: var(--primary-button);
  color: #ffffff;
}

.copilotToolbar .ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.copilotToolbar button[aria-pressed="true"] {
  border-color: var(--success);
  background: rgba(var(--success-rgb), 0.18);
  color: var(--success);
}

.copilotMeta {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.copilotMeta[data-state="on"] {
  color: var(--success);
}

.copilotConsent {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 11px;
  background: rgba(120, 53, 15, 0.16);
  border-bottom: 1px solid var(--line);
}

.copilotConsent input {
  accent-color: var(--accent);
}

.copilotBody {
  display: flex;
  flex-direction: column;
  padding: 10px;
  min-height: 0;
  flex: 1;
}

.copilotColumn {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--glass);
  overflow: hidden;
}

.copilotColumnHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.copilotAutoAnswer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
}

.copilotAutoAnswer input {
  accent-color: var(--accent);
}

.copilotRecording {
  color: var(--danger);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.copilotRecording.active::before {
  content: "● ";
  animation: copilotPulse 1s ease-in-out infinite;
}

.copilotTranscript {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.copilotLine {
  position: relative;
  padding: 7px 42px 7px 8px;
  border-radius: 9px;
  background: rgba(245, 164, 0, 0.08);
  border-left: 2px solid var(--accent);
  transition: border-color 180ms ease, background 180ms ease;
}

.copilotLine.me {
  border-left-color: var(--primary-button);
  background: rgba(30, 27, 75, 0.12);
}

.copilotLine.partial {
  opacity: 0.66;
  font-style: italic;
}

.copilotLine.question {
  border-left-color: var(--accent);
  background: rgba(245, 164, 0, 0.12);
}

.copilotTranscriptText {
  display: block;
  line-height: 1.45;
}

.copilotSpeaker {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.copilotSpeaker[hidden] {
  display: none;
}

.copilotQuestionDetected {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--warning);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.copilotQuestionDetected[hidden] {
  display: none;
}

.copilotAskLine {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  transform: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--glass);
  color: var(--primary-button);
  cursor: pointer;
  opacity: 0;
  transition: opacity 150ms ease, background 150ms ease;
}

.copilotAskLine svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.copilotLine:hover .copilotAskLine,
.copilotLine:focus-within .copilotAskLine,
.copilotAskLine:focus-visible {
  opacity: 1;
}

.copilotAskLine:hover:not(:disabled) {
  background: rgba(var(--primary-button-rgb), 0.18);
}

.copilotAskLine:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

@media (hover: none) {
  .copilotAskLine {
    opacity: 1;
  }
}

.copilotMuted {
  margin: 0;
  color: var(--muted);
  font-style: italic;
}

.copilotJumpLatest {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--primary-button);
  padding: 5px 10px;
  font-size: 10px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: opacity 180ms ease, transform 180ms ease;
}

.copilotJumpLatest[hidden] {
  display: none;
}

.copilotPanel button,
.copilotPanel input {
  outline: none;
}

.copilotPanel button:focus-visible,
.copilotPanel input:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
}

@keyframes copilotPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes copilotWave {
  0%, 100% { height: 5px; }
  50% { height: 14px; }
}

@media (max-width: 720px) {
  .copilotPanel {
    position: static;
    width: 100%;
    height: min(72vh, 680px);
    min-width: 0;
  }

  .copilotBody {
    grid-template-columns: 1fr;
  }

  .copilotStatusGroup {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .copilotHeader button {
    margin-left: auto;
  }
}