/* PRISM — platform section chat companion
   Mostly black (~80%) with a soft ~20% gold wash */

.companion-chat,
.agent-brief-panel {
  margin: 0;
  padding: 18px;
  border: 1px solid rgba(201, 169, 110, 0.18);
  border-left: 3px solid rgba(201, 169, 110, 0.55);
  background:
    radial-gradient(ellipse at right center, rgba(201, 169, 110, 0.2) 0%, rgba(201, 169, 110, 0.06) 38%, transparent 68%),
    #000000;
  box-shadow: none;
  border-radius: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  font-family: var(--core-font-ui, "Jost", sans-serif);
}

/* Keep CORE Agent chrome when section classes stack (ap-panel, au-agent-chat, etc.) */
aside.companion-chat:not(.agpt-panel):not(.is-atlas),
.companion-chat.ai-prompt-bar,
.companion-chat.ap-diagnostic-panel,
.companion-chat.au-agent-chat,
.companion-chat.resource-prism-bar,
.companion-chat.caa-area-chat,
.companion-chat.core-agent-companion,
.companion-chat.panel {
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid rgba(201, 169, 110, 0.18);
  border-left: 3px solid rgba(201, 169, 110, 0.55);
  background:
    radial-gradient(ellipse at right center, rgba(201, 169, 110, 0.2) 0%, rgba(201, 169, 110, 0.06) 38%, transparent 68%),
    #000000;
  box-shadow: none;
  border-radius: 0;
  color: inherit;
}

.companion-chat-head,
.agent-brief-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.companion-chat-head-main {
  min-width: 0;
}

.companion-chat-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}

.companion-chat-name,
.companion-chat-head h3,
.companion-chat h3.companion-chat-title,
.companion-chat.panel h3,
.agent-brief-head h3 {
  margin: 0;
  font-family: "Inter", "Jost", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--core-gold, #c9a96e);
}

.companion-chat-purpose,
.agent-brief-purpose {
  margin: 0;
  max-width: 42rem;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.5;
  color: rgba(196, 196, 196, 0.78);
}

.companion-chat-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.companion-chat .core-agent-chat-mode,
.companion-chat .ai-prompt-setup,
.companion-chat .companion-chat-mode {
  margin: 0;
  font-size: 12px;
  font-weight: 300;
  line-height: 1.45;
  color: rgba(196, 196, 196, 0.65);
}

.companion-chat .ai-prompt-form,
.companion-chat .ai-prompt-row {
  margin: 0;
}

.companion-chat .ai-prompt-head,
.companion-chat .ai-prompt-title,
.companion-chat .ai-prompt-desc {
  display: none;
}

.companion-chat .ai-prompt-mode {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(201, 169, 110, 0.7);
  white-space: nowrap;
}

/* Shared PRISM ask field — match CORE Agent geometry everywhere */
.prism-ask-bar,
.companion-chat .prism-ask-bar,
.companion-chat .core-agent-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  min-height: 48px;
  margin: 8px 0 0;
  width: 100%;
  max-width: 100%;
  padding: 0 14px;
  border: 1px solid rgba(201, 169, 110, 0.22);
  background: #141414;
  border-radius: 0;
  box-sizing: border-box;
}

.prism-ask-mark,
.companion-chat .core-agent-mark,
.prism-ask-bar .core-agent-mark {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 1.5px solid var(--core-gold, #c9a96e);
  transform: rotate(45deg);
  transform-origin: center center;
  cursor: default;
  will-change: transform;
}

.prism-ask-mark.is-spinning,
.companion-chat .core-agent-mark.is-spinning {
  animation: prism-ask-mark-spin-once 1s forwards;
}

.prism-ask-mark.is-rest,
.companion-chat .core-agent-mark.is-rest {
  transform: rotate(495deg);
}

@keyframes prism-ask-mark-spin-once {
  0% {
    transform: rotate(45deg);
    animation-timing-function: linear;
  }
  50% {
    transform: rotate(405deg);
    animation-timing-function: cubic-bezier(0.05, 0.7, 0.1, 1);
  }
  100% {
    transform: rotate(495deg);
  }
}

.prism-ask-input,
.prism-ask-bar .prism-ask-input,
.companion-chat .core-agent-input,
.companion-chat .prism-ask-input,
.companion-chat .ai-prompt-input,
.companion-chat .ap-diagnostic-input,
.companion-chat .resource-mode-input,
.companion-chat .support-input,
.companion-chat .prism-ask-bar input[type="text"],
.companion-chat .prism-ask-bar input[type="search"],
.companion-chat input[type="text"],
.companion-chat input[type="search"] {
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #c8c8c8;
  -webkit-text-fill-color: #c8c8c8;
  caret-color: var(--core-gold, #c9a96e);
  font-family: "Jost", "Inter", sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  box-shadow: none;
}

.prism-ask-input::placeholder,
.companion-chat .core-agent-input::placeholder,
.companion-chat input::placeholder {
  color: #7a7a7a;
  -webkit-text-fill-color: #7a7a7a;
  opacity: 1;
}

.prism-ask-input:focus,
.companion-chat input:focus {
  color: #d8d8d8;
  -webkit-text-fill-color: #d8d8d8;
  outline: none;
  box-shadow: none;
}

.companion-chat input:-webkit-autofill,
.companion-chat input:-webkit-autofill:hover,
.companion-chat input:-webkit-autofill:focus {
  -webkit-text-fill-color: #c8c8c8;
  caret-color: var(--core-gold, #c9a96e);
  box-shadow: 0 0 0 1000px #141414 inset;
  transition: background-color 99999s ease-out;
}

.prism-ask-shortcut,
.companion-chat .core-agent-shortcut {
  flex-shrink: 0;
  font-family: "Jost", "Inter", sans-serif;
  font-size: 10px;
  color: #6b6b6b;
}

.prism-ask-submit,
.companion-chat .prism-ask-submit {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 1px solid rgba(201, 169, 110, 0.4);
  background: transparent;
  color: var(--core-gold, #c9a96e);
  font-family: "Jost", "Inter", sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.prism-ask-submit:hover:not(:disabled),
.companion-chat .prism-ask-submit:hover:not(:disabled) {
  background: rgba(201, 169, 110, 0.08);
}

.prism-ask-submit:disabled,
.companion-chat .prism-ask-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.companion-chat .core-agent-chat {
  border-top: 0;
  margin-top: 4px;
}

.companion-chat .core-agent-chat-mode {
  background: transparent;
  border-top: 0;
  padding: 0;
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 300;
  line-height: 1.45;
  letter-spacing: 0;
  color: rgba(196, 196, 196, 0.65);
}

.companion-chat .core-agent-thread {
  background: transparent;
}

.companion-chat .core-agent-chat.is-open .core-agent-thread {
  border-left: 0;
  border-right: 0;
}

.companion-chat .core-agent-empty-state {
  padding: 12px 0;
}

.companion-chat .ap-diagnostic-questions,
.companion-chat .au-agent-chat-empty,
.companion-chat .resource-strategic-questions,
.companion-chat .resource-strategy-objectives {
  margin: 0 0 8px;
}

.companion-chat-body > .core-agent-chat {
  gap: 0;
}

.theme-dark .ai-prompt-bar.companion-chat,
.theme-dark aside.companion-chat.ai-prompt-bar {
  background:
    radial-gradient(ellipse at right center, rgba(201, 169, 110, 0.2) 0%, rgba(201, 169, 110, 0.06) 38%, transparent 68%),
    #000000;
  border-color: rgba(201, 169, 110, 0.18);
}

.companion-chat.is-global {
  border-left-width: 3px;
}

.agpt-panel.companion-chat .agpt-head-title strong {
  color: var(--core-gold, #c9a96e);
  font-family: "Inter", "Jost", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.atlas-title-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.atlas-globe {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-gold, #c9a96e);
  line-height: 0;
  flex-shrink: 0;
}

.atlas-globe svg {
  display: block;
  overflow: visible;
}

/* Slow globe turn — meridians drift on the Y-axis (not a flat spin / bounce). */
.atlas-globe--spin .atlas-globe-meridians {
  transform-box: view-box;
  transform-origin: 12px 12px;
  animation: atlas-globe-turn 18s linear infinite;
}

.atlas-globe--spin .atlas-globe-lat {
  opacity: 0.85;
}

@keyframes atlas-globe-turn {
  0% { transform: scaleX(1); }
  25% { transform: scaleX(0.12); }
  50% { transform: scaleX(-1); }
  75% { transform: scaleX(-0.12); }
  100% { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-globe--spin .atlas-globe-meridians {
    animation: none;
  }
}

.atlas-globe--ask {
  width: 16px;
  height: 16px;
}

.atlas-globe--ask svg {
  width: 16px;
  height: 16px;
}

.agpt-launcher .atlas-globe {
  width: 26px;
  height: 26px;
  color: inherit;
}

.agpt-launcher .atlas-globe svg {
  width: 26px;
  height: 26px;
}

.oa-reporting .oa-reporting-assistant.companion-chat,
.oa-reporting .companion-chat.ai-prompt-bar {
  margin-top: 16px;
}

/* Top-bar PRISM ask — keep shell layout, share diamond mark behaviour */
.ask-agpt-bar.prism-ask-bar.is-topbar {
  height: auto;
  margin: 0;
  padding: inherit;
  border: 0;
  background: transparent;
}

.ask-agpt-bar.prism-ask-bar.is-topbar .prism-ask-mark {
  margin-right: 2px;
}

.agpt-panel.companion-chat .prism-ask-bar {
  margin: 10px 12px 8px;
  width: auto;
}
