/* GDH Dev AI Help — floating widget (platform + 15 domain) */
.gdh-dev-ai-btn {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 10050;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(145deg, #0f766e, #2563eb);
  color: #fff;
  font-size: 1.35rem;
  box-shadow: 0 0.4rem 1.25rem rgba(37, 99, 235, 0.45);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gdh-dev-ai-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0.5rem 1.5rem rgba(37, 99, 235, 0.55);
}

.gdh-dev-ai-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10055;
  background: rgba(15, 23, 42, 0.4);
}

.gdh-dev-ai-backdrop.hidden {
  display: none;
}

.gdh-dev-ai-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5rem;
  z-index: 10060;
  width: min(520px, calc(100vw - 2rem));
  max-height: min(78vh, 680px);
  display: flex;
  flex-direction: column;
  border: 1px solid #cbd5e1;
  border-radius: 0.85rem;
  background: #f8fafc;
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.gdh-dev-ai-panel.hidden {
  display: none;
}

.gdh-dev-ai-panel--fullscreen {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  border: none;
  z-index: 10065;
}

.gdh-dev-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.gdh-dev-ai-header h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.gdh-dev-ai-header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.gdh-dev-ai-bot-select {
  font-size: 0.72rem;
  padding: 0.15rem 0.35rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.35rem;
  background: #f8fafc;
  color: #334155;
  max-width: 5.5rem;
}

.gdh-dev-ai-bot-label {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.gdh-dev-ai-meta {
  padding: 0.45rem 0.9rem;
  background: #ecfdf5;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.72rem;
  color: #475569;
}

.gdh-dev-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.gdh-dev-ai-turn {
  display: flex;
  width: 100%;
}

.gdh-dev-ai-turn--user {
  justify-content: flex-end;
}

.gdh-dev-ai-turn--bot,
.gdh-dev-ai-turn--error {
  justify-content: flex-start;
}

.gdh-dev-ai-bubble {
  border-radius: 1rem;
  padding: 0.55rem 0.75rem;
  max-width: 92%;
  font-size: 0.82rem;
  line-height: 1.45;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.gdh-dev-ai-bubble--user {
  background: linear-gradient(135deg, #0d9488, #2563eb);
  color: #fff;
  border-bottom-right-radius: 0.25rem;
}

.gdh-dev-ai-bubble--bot {
  background: #fff;
  color: #1e293b;
  border-bottom-left-radius: 0.25rem;
  max-width: 100%;
  width: 100%;
}

.gdh-dev-ai-bubble--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.gdh-dev-ai-msg-md {
  font-size: 0.8rem;
  line-height: 1.55;
}

.gdh-dev-ai-msg-md a[href^="doc://"] {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  font-weight: 500;
}

.gdh-dev-ai-msg-md a[href^="doc://"]:hover {
  color: #1d4ed8;
}

.gdh-dev-ai-msg-md pre {
  overflow-x: auto;
  padding: 0.5rem;
  border-radius: 0.35rem;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.74rem;
}

.gdh-dev-ai-form {
  display: flex;
  gap: 0.35rem;
  padding: 0.65rem 0.85rem;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  align-items: center;
}

.gdh-dev-ai-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.gdh-dev-ai-form input {
  width: 100%;
  font-size: 0.82rem;
  position: relative;
  z-index: 1;
  background: transparent;
}

.gdh-dev-ai-slide-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  color: #94a3b8;
  font-size: 0.82rem;
  line-height: 1.4;
}

.gdh-dev-ai-input-wrap.is-typing .gdh-dev-ai-slide-ph,
.gdh-dev-ai-input-wrap.is-focused .gdh-dev-ai-slide-ph {
  opacity: 0;
  visibility: hidden;
}

.gdh-dev-ai-slide-ph__text {
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateY(-110%);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.gdh-dev-ai-slide-ph__text.is-in {
  transform: translateY(0);
  opacity: 1;
}

.gdh-dev-ai-slide-ph__text.is-out {
  transform: translateY(110%);
  opacity: 0;
}

.gdh-dev-ai-form button {
  white-space: nowrap;
}

.gdh-dev-ai-typing span {
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin-right: 0.2rem;
  border-radius: 50%;
  background: #94a3b8;
  animation: gdh-dev-ai-dot 1.2s infinite ease-in-out;
}

.gdh-dev-ai-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.gdh-dev-ai-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes gdh-dev-ai-dot {
  0%,
  80%,
  100% {
    opacity: 0.35;
  }
  40% {
    opacity: 1;
  }
}

/* S4 — evidence chips */
.gdh-dev-ai-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.gdh-dev-ai-evidence__label {
  width: 100%;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: #64748b;
  margin-bottom: 0.1rem;
}

.gdh-dev-ai-evidence__chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.2rem 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.35rem;
  background: #f8fafc;
  color: #0f766e;
  font-size: 0.72rem;
  line-height: 1.3;
  cursor: pointer;
  text-align: left;
}

.gdh-dev-ai-evidence__chip:hover {
  background: #ecfdf5;
  border-color: #5eead4;
}

.gdh-dev-ai-evidence__chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Preview hash flash (S4 highlight) */
.gdh-cto-hash-flash {
  animation: gdh-cto-hash-flash 2.1s ease;
  outline: 2px solid #0d9488;
  outline-offset: 3px;
  border-radius: 0.25rem;
  background: rgba(45, 212, 191, 0.18);
}

@keyframes gdh-cto-hash-flash {
  0% {
    background: rgba(45, 212, 191, 0.42);
  }
  100% {
    background: transparent;
  }
}
