/* NEO-R1 — compagnon lecture/guidage. Ne pas appliquer à #p110-cockpit. */
#neoR1Toggle {
  position: relative;
  flex-shrink: 0;
}
#neoR1Toggle[data-neo-state="speaking"] .neo-r1-dot {
  background: #fbbf24;
}
#neoR1Toggle[data-neo-state="open"] .neo-r1-dot {
  background: #34d399;
}
#neoR1Toggle[data-neo-state="unavailable"] {
  opacity: 0.45;
}
.neo-r1-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
}
@media (prefers-reduced-motion: no-preference) {
  #neoR1Toggle[data-neo-state="speaking"] .neo-r1-dot {
    animation: neo-r1-pulse 1.2s ease-in-out infinite;
  }
}
@keyframes neo-r1-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  #neoR1Toggle[data-neo-state="speaking"] .neo-r1-dot {
    animation: none;
  }
  .neo-r1-spotlight {
    transition: none;
  }
}

#neoR1Panel {
  position: fixed;
  top: max(8px, env(safe-area-inset-top, 0px));
  right: max(8px, env(safe-area-inset-right, 0px));
  width: min(400px, calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
  height: auto;
  z-index: 1400;
  display: none;
  flex-direction: column;
  min-height: 0;
  background: var(--color-bg-700, #0f172a);
  color: var(--color-on-dark, #e2e8f0);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
#neoR1Panel.is-open {
  display: flex;
}
#neoR1Panel :focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}
.neo-r1-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.neo-r1-head h2 {
  margin: 0;
  font-size: 0.95rem;
}
.neo-r1-disclosure {
  margin: 0;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: #93c5fd;
  flex-shrink: 0;
}
#neoR1Mode {
  padding: 0 12px 8px;
  flex-shrink: 0;
  word-break: break-word;
}
.neo-r1-proposals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 8px;
  overflow-x: hidden;
  max-width: 100%;
}
.neo-r1-proposals .btn {
  max-width: 100%;
  white-space: normal;
  text-align: left;
}
.neo-r1-proposals .btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}
.neo-r1-diag-panel {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  margin: 8px 0 0;
  padding: 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.35);
}
.neo-r1-diag-facts {
  margin: 6px 0;
  padding-left: 1.1rem;
  font-size: 0.8rem;
}
.neo-r1-diag-refs {
  min-width: 0;
  max-width: 100%;
}
.neo-r1-diag-refs summary:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}
.neo-r1-source-view {
  margin: 0 0 8px 8px;
  min-width: 0;
  max-width: 100%;
}
.neo-r1-source-view summary:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}
.neo-r1-diag-excerpt {
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  white-space: pre-wrap;
}
.neo-r1-diag-subject,
.neo-r1-diag-q {
  margin: 0 0 4px;
  font-size: 0.8rem;
  font-weight: 600;
}
.neo-r1-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.neo-r1-log {
  flex: 0 0 auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.neo-r1-msg {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.neo-r1-msg--user {
  background: rgba(56, 189, 248, 0.12);
  align-self: flex-end;
}
.neo-r1-msg--neo {
  background: rgba(255, 255, 255, 0.06);
  align-self: stretch;
}
.neo-r1-steps {
  margin: 0;
  padding: 0 12px 8px 32px;
  font-size: 0.8rem;
}
.neo-r1-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 0;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: hidden;
}
.neo-r1-more {
  margin: 0;
  max-height: min(42dvh, 320px);
  overflow-x: hidden;
  overflow-y: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 6px;
}
.neo-r1-more summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: #93c5fd;
}
.neo-r1-hint {
  margin: 6px 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #94a3b8;
}
.neo-r1-diag-wrap {
  margin-top: 8px;
}
.neo-r1-diag {
  margin: 6px 0;
  padding: 8px;
  max-height: 9rem;
  overflow: auto;
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
}
@media (max-width: 480px) {
  #neoR1Panel {
    left: max(8px, env(safe-area-inset-left, 0px));
    width: auto;
  }
}
.neo-r1-form textarea {
  min-height: 64px;
  resize: vertical;
}
.neo-r1-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.neo-r1-prefs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.75rem;
}
.neo-r1-spotlight {
  outline: 3px solid #38bdf8;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.2);
}
.neo-r1-status {
  margin: 0;
  font-size: 0.75rem;
  color: #93c5fd;
  min-height: 1.1em;
}
.neo-r1-listen {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.12);
}
.neo-r1-listen.is-active {
  display: flex;
}
.neo-r1-listen-label {
  font-size: 0.8rem;
  font-weight: 600;
}
#neoR1Toggle[data-neo-state="listening"] .neo-r1-dot {
  background: #f87171;
}
@media (prefers-reduced-motion: no-preference) {
  #neoR1Toggle[data-neo-state="listening"] .neo-r1-dot {
    animation: neo-r1-pulse 1.2s ease-in-out infinite;
  }
}
@media (prefers-reduced-motion: reduce) {
  #neoR1Toggle[data-neo-state="listening"] .neo-r1-dot {
    animation: none;
  }
}
.neo-r1-rate {
  display: flex;
  align-items: center;
  gap: 6px;
}
.neo-r1-voice-pick {
  flex: 1 1 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.neo-r1-voice-pick select {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}
.neo-r1-pitch {
  flex: 1 1 100%;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.neo-r1-pitch input[type="range"] {
  flex: 1 1 8rem;
  min-width: 0;
  max-width: 100%;
}
#neoR1Mic[aria-pressed="true"] {
  outline: 2px solid #f87171;
}
