/* Floating student assistant (bottom-right) */
.psh-ai-assistant-widget {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 99990;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

.psh-ai-assistant-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.45);
}

.psh-ai-assistant-toggle:hover {
  filter: brightness(1.05);
}

.psh-ai-assistant-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.6rem);
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(28rem, 70vh);
  background: #fff;
  color: #1d2327;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.psh-ai-assistant-panel[hidden] {
  display: none !important;
}

.psh-ai-assistant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: #f6f7f7;
  border-bottom: 1px solid #dcdcde;
  font-weight: 600;
  font-size: 0.95rem;
}

.psh-ai-assistant-close {
  border: 0;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem;
  color: #50575e;
}

.psh-ai-assistant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.psh-ai-msg {
  max-width: 92%;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  font-size: 0.92rem;
}

.psh-ai-msg--bot {
  align-self: flex-start;
  background: #f0f6fc;
  border: 1px solid #c3d9ed;
  white-space: pre-wrap;
}

.psh-ai-msg--user {
  align-self: flex-end;
  background: #e7f5e9;
  border: 1px solid #b8e0bf;
}

.psh-ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.psh-ai-chip {
  border: 1px solid #c3c4c7;
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.psh-ai-chip:hover {
  border-color: #2563eb;
  color: #1d4ed8;
}

.psh-ai-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.psh-ai-actions button {
  text-align: left;
}

.psh-ai-footer {
  padding: 0.55rem 0.75rem;
  border-top: 1px solid #dcdcde;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.psh-ai-footer input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.5rem;
  border: 1px solid #c3c4c7;
  border-radius: 6px;
  font-size: 0.9rem;
}

.psh-ai-footer .psh-ai-row {
  display: flex;
  gap: 0.35rem;
}

.psh-ai-footer .psh-ai-row input {
  flex: 1;
}

.psh-ai-send {
  border: 0;
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.88rem;
}

.psh-ai-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.psh-ai-suggestions {
  font-size: 0.82rem;
  margin-top: 0.35rem;
}

.psh-ai-suggestions a {
  display: block;
  margin-top: 0.2rem;
  color: #1d4ed8;
}
