/* Ask AuditGPT — header bar + orchestrator response drawer */

.ask-agpt-bar {
  --ask-gold: var(--brand-gold, #c9a96e);
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1 1 280px;
  min-width: 200px;
  max-width: 520px;
  margin: 0 12px 0 0;
  border: 1px solid rgba(201, 169, 110, 0.45);
  background: rgba(201, 169, 110, 0.06);
  border-radius: 0;
}

.ask-agpt-bar-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.ask-agpt-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--text-primary, #f2f2f2);
  font-family: "Jost", "Inter", sans-serif;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.35;
  outline: none;
  border-radius: 0;
}

.ask-agpt-input::placeholder {
  color: var(--text-muted, #8a8580);
  opacity: 1;
}

.ask-agpt-submit {
  flex-shrink: 0;
  padding: 8px 14px;
  border: 0;
  border-left: 1px solid rgba(201, 169, 110, 0.45);
  background: transparent;
  color: var(--ask-gold);
  font-family: "Jost", "Inter", sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
}

.ask-agpt-submit:hover:not(:disabled) {
  background: rgba(201, 169, 110, 0.12);
}

.ask-agpt-submit:disabled,
.ask-agpt-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.workspace-utility-rail .ask-agpt-bar {
  max-width: none;
  flex: 1 1 auto;
  margin-right: 8px;
}

.theme-light .ask-agpt-bar {
  background: rgba(154, 123, 79, 0.06);
  border-color: rgba(154, 123, 79, 0.4);
}

.theme-light .ask-agpt-input {
  color: var(--text-primary, #1a1a1a);
}

.theme-light .ask-agpt-submit {
  border-left-color: rgba(154, 123, 79, 0.4);
  color: var(--brand-gold, #9a7b4f);
}

/* ── Response drawer ── */

.ask-agpt-drawer {
  --ask-gold: var(--brand-gold, #c9a96e);
  position: fixed;
  top: 0;
  right: 0;
  z-index: 860;
  width: min(440px, 100vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-elevated, #141414);
  border-left: 1px solid rgba(201, 169, 110, 0.35);
  border-radius: 0;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  font-family: "Jost", "Inter", sans-serif;
  color: var(--text-primary, #f2f2f2);
}

.ask-agpt-drawer.is-open {
  transform: translateX(0);
}

.ask-agpt-backdrop {
  position: fixed;
  inset: 0;
  z-index: 850;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  border-radius: 0;
}

.ask-agpt-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ask-agpt-eyebrow {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ask-gold);
}

.ask-agpt-title {
  margin: 0;
  font-family: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1.15;
  color: var(--text-primary, #f2f2f2);
}

.ask-agpt-close {
  border: 0;
  background: transparent;
  color: var(--text-muted, #9a948a);
  font-size: 16px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 0;
}

.ask-agpt-close:hover {
  color: var(--ask-gold);
}

.ask-agpt-drawer-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 20px 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ask-agpt-question {
  margin: 0;
  padding: 14px 16px;
  border-left: 2px solid var(--ask-gold);
  background: rgba(201, 169, 110, 0.07);
  font-size: 14px;
  line-height: 1.45;
  border-radius: 0;
}

.ask-agpt-question-label {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ask-gold);
}

.ask-agpt-routed {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-primary, #f2f2f2);
}

.ask-agpt-routed-label {
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--ask-gold);
  margin-right: 6px;
}

.ask-agpt-ai-label {
  margin: 0 0 12px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ask-gold);
}

.ask-agpt-answer-body,
.ask-agpt-attribution-body {
  font-size: 13.5px;
  line-height: 1.55;
}

.ask-agpt-answer-body p,
.ask-agpt-attribution-body p {
  margin: 0 0 0.75em;
}

.ask-agpt-answer-body strong,
.ask-agpt-attribution-body strong {
  font-weight: 500;
}

.ask-agpt-attribution {
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ask-agpt-attribution:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.ask-agpt-attribution-head {
  margin: 0 0 8px;
  font-family: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text-primary, #f2f2f2);
}

.ask-agpt-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
}

.ask-agpt-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ask-gold);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 0;
  text-align: left;
}

.ask-agpt-link:hover {
  text-decoration: underline;
}

.ask-agpt-sources {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted, #9a948a);
}

.ask-agpt-sources summary {
  cursor: pointer;
  color: var(--ask-gold);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ask-agpt-sources ul {
  margin: 8px 0 0;
  padding-left: 1.1em;
}

.ask-agpt-thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted, #9a948a);
}

.ask-agpt-thinking-dot {
  width: 8px;
  height: 8px;
  background: var(--ask-gold);
  border-radius: 0;
  animation: ask-agpt-pulse 1s ease-in-out infinite;
}

@keyframes ask-agpt-pulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

.ask-agpt-empty,
.ask-agpt-clarify,
.ask-agpt-nomatch,
.ask-agpt-error {
  font-size: 13.5px;
  line-height: 1.5;
}

.ask-agpt-empty p,
.ask-agpt-clarify p,
.ask-agpt-nomatch p,
.ask-agpt-error p {
  margin: 0 0 12px;
}

.ask-agpt-options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ask-agpt-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(201, 169, 110, 0.35);
  background: rgba(201, 169, 110, 0.05);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
}

.ask-agpt-option:hover {
  border-color: var(--ask-gold);
  background: rgba(201, 169, 110, 0.1);
}

.ask-agpt-option strong {
  font-family: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 400;
}

.ask-agpt-closest-label {
  margin: 16px 0 8px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.theme-light .ask-agpt-drawer {
  background: #f7f4ef;
  border-left-color: rgba(154, 123, 79, 0.35);
  color: #1a1a1a;
}

.theme-light .ask-agpt-question {
  background: rgba(154, 123, 79, 0.08);
}

.theme-light .ask-agpt-attribution {
  border-bottom-color: rgba(16, 24, 32, 0.1);
}

.theme-light .ask-agpt-option {
  background: rgba(154, 123, 79, 0.05);
  border-color: rgba(154, 123, 79, 0.35);
}

.app-shell.is-ask-open .work-queue-panel.is-open {
  /* Prefer Ask drawer when both would compete */
}

@media (max-width: 720px) {
  .ask-agpt-bar {
    max-width: none;
    flex: 1 1 100%;
    order: -1;
    margin: 0 0 8px;
  }

  .topbar .split-actions {
    flex-wrap: wrap;
  }

  .ask-agpt-drawer {
    width: 100vw;
  }
}
