/* ============================================
   Priodemy "Ask Priodemy" Search System Styles
   Components: Command Palette, Chat Widget, /ask Page
   ============================================ */

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
  --prio-brand: #d1039e;
  --prio-brand-dark: #5b026b;
  --prio-brand-light: #f5d0ea;
  --prio-brand-glow: rgba(209, 3, 158, 0.3);
  --prio-bg: #ffffff;
  --prio-bg-secondary: #f5f5f7;
  --prio-bg-dark: #1a1a2e;
  --prio-bg-darker: #141425;
  --prio-text: #1a1a1a;
  --prio-text-secondary: #6b6b6b;
  --prio-text-light: #999;
  --prio-text-white: #f0f0f0;
  --prio-border: rgba(0, 0, 0, 0.08);
  --prio-radius: 12px;
  --prio-radius-sm: 8px;
  --prio-radius-lg: 16px;
  --prio-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  --prio-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.2);
  --prio-font: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --prio-font-mono: "SF Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
  --prio-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* Course colors */
  --prio-html: #e34c26;
  --prio-css: #264de4;
  --prio-js: #f7df1e;
  --prio-robotics: #00979d;
}

[data-theme="dark"] {
  --prio-bg: #121212;
  --prio-bg-secondary: #1e1e1e;
  --prio-text: #e0e0e0;
  --prio-text-secondary: #aaa;
  --prio-text-light: #777;
  --prio-border: rgba(255, 255, 255, 0.08);
  --prio-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --prio-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --prio-brand-light: #3a1030;
}

/* ============================================
   SHARED COMPONENT STYLES
   ============================================ */

/* Response summary formatted text */
.prio-response-summary {
  font-family: var(--prio-font);
  font-size: 0.938rem;
  line-height: 1.7;
  color: inherit;
}

.prio-response-summary p {
  margin: 0 0 0.75em;
}

.prio-response-summary strong {
  font-weight: 600;
  color: inherit;
}

.prio-response-summary ul {
  margin: 0.5em 0 1em;
  padding-left: 1.25em;
  list-style: none;
}

.prio-response-summary ul li {
  position: relative;
  padding: 0.25em 0;
  padding-left: 0.5em;
}

.prio-response-summary ul li::before {
  content: "";
  position: absolute;
  left: -1em;
  top: 0.7em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--prio-brand);
}

/* Code block */
.prio-code-block {
  position: relative;
  margin: 1em 0;
  border-radius: var(--prio-radius-sm);
  overflow: hidden;
}

.prio-code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5em 1em;
  background: #0d0d1a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.prio-code-lang-badge {
  font-family: var(--prio-font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  font-weight: 500;
}

.prio-code-copy-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #aaa;
  font-size: 0.75rem;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--prio-font);
  transition: all var(--prio-transition);
}

.prio-code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ddd;
  border-color: rgba(255, 255, 255, 0.2);
}

.prio-code-copy-btn.prio-copied {
  color: #4caf50;
  border-color: #4caf50;
}

.prio-code-block pre {
  margin: 0;
  padding: 1em;
  background: #111128;
  color: #e0e0e0;
  font-family: var(--prio-font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}

.prio-code-block pre::-webkit-scrollbar {
  height: 6px;
}

.prio-code-block pre::-webkit-scrollbar-track {
  background: transparent;
}

.prio-code-block pre::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* Source link */
.prio-source-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-top: 0.75em;
  padding: 0.4em 0.8em;
  font-size: 0.8rem;
  color: var(--prio-brand);
  text-decoration: none;
  background: rgba(209, 3, 158, 0.06);
  border: 1px solid rgba(209, 3, 158, 0.15);
  border-radius: 6px;
  transition: all var(--prio-transition);
  cursor: pointer;
  font-family: var(--prio-font);
}

.prio-source-link:hover {
  background: rgba(209, 3, 158, 0.12);
  border-color: rgba(209, 3, 158, 0.3);
  transform: translateY(-1px);
}

.prio-source-link::before {
  content: "\2197";
  font-size: 0.9em;
}

/* Related topic chips */
.prio-related-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-top: 1em;
}

.prio-related-topics-label {
  font-size: 0.75rem;
  color: var(--prio-text-secondary);
  width: 100%;
  margin-bottom: 0.25em;
  font-family: var(--prio-font);
}

.prio-related-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3em 0.75em;
  font-size: 0.78rem;
  color: var(--prio-text-secondary);
  background: var(--prio-bg-secondary);
  border: 1px solid var(--prio-border);
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--prio-transition);
  font-family: var(--prio-font);
  white-space: nowrap;
}

.prio-related-chip:hover {
  color: var(--prio-brand);
  border-color: var(--prio-brand);
  background: rgba(209, 3, 158, 0.06);
  transform: translateY(-1px);
}

/* Typing cursor */
.prio-typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--prio-brand);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: prio-blink 0.8s step-end infinite;
}

@keyframes prio-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Typing dots */
.prio-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.5em 0;
}

.prio-typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--prio-text-light);
  animation: prio-bounce-dot 1.4s ease-in-out infinite;
}

.prio-typing-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.prio-typing-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes prio-bounce-dot {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Note/highlight box */
.prio-note-box {
  padding: 0.75em 1em;
  margin: 0.75em 0;
  background: rgba(209, 3, 158, 0.06);
  border-left: 3px solid var(--prio-brand);
  border-radius: 0 var(--prio-radius-sm) var(--prio-radius-sm) 0;
  font-size: 0.85rem;
  color: var(--prio-text-secondary);
  line-height: 1.6;
}

.prio-exercise-box {
  padding: 0.75em 1em;
  margin: 0.75em 0;
  background: rgba(16, 185, 129, 0.06);
  border-left: 3px solid #10b981;
  border-radius: 0 var(--prio-radius-sm) var(--prio-radius-sm) 0;
  font-size: 0.85rem;
  color: var(--prio-text-secondary);
  line-height: 1.6;
}

[data-theme="dark"] .prio-exercise-box {
  background: rgba(16, 185, 129, 0.1);
  color: #a3e6c8;
}

/* Skip animation button */
.prio-skip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  margin-top: 0.5em;
  padding: 0.3em 0.7em;
  font-size: 0.72rem;
  color: var(--prio-text-light);
  background: transparent;
  border: 1px solid var(--prio-border);
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--prio-font);
  transition: all var(--prio-transition);
}

.prio-skip-btn:hover {
  color: var(--prio-text-secondary);
  border-color: var(--prio-text-secondary);
}

/* ============================================
   COMMAND PALETTE
   ============================================ */

/* Overlay */
.prio-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.prio-palette-overlay.prio-active {
  opacity: 1;
  visibility: visible;
}

/* Modal */
.prio-palette {
  width: 100%;
  max-width: 640px;
  background: var(--prio-bg-dark);
  border-radius: var(--prio-radius-lg);
  box-shadow: var(--prio-shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.06);
  color: var(--prio-text-white);
  overflow: hidden;
  transform: translateY(-20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.prio-palette-overlay.prio-active .prio-palette {
  transform: translateY(0) scale(1);
}

/* Input area */
.prio-palette-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 1.25em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.prio-palette-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--prio-brand);
  opacity: 0.9;
}

.prio-palette-input {
  flex: 1;
  padding: 1em 0.75em;
  background: none;
  border: none;
  outline: none;
  color: var(--prio-text-white);
  font-size: 1rem;
  font-family: var(--prio-font);
  caret-color: var(--prio-brand);
}

.prio-palette-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.prio-palette-esc {
  flex-shrink: 0;
  padding: 0.15em 0.5em;
  font-size: 0.65rem;
  font-family: var(--prio-font);
  color: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Suggestions list */
.prio-palette-suggestions {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.prio-palette-suggestions::-webkit-scrollbar {
  width: 5px;
}

.prio-palette-suggestions::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.prio-palette-suggestion {
  display: flex;
  align-items: flex-start;
  gap: 0.75em;
  padding: 0.75em 1.25em;
  cursor: pointer;
  transition: background 0.12s ease;
}

.prio-palette-suggestion:hover,
.prio-palette-suggestion.prio-active {
  background: rgba(255, 255, 255, 0.05);
}

.prio-palette-suggestion.prio-active {
  background: rgba(209, 3, 158, 0.1);
}

.prio-palette-sug-badge {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 0.55em;
}

.prio-palette-sug-content {
  flex: 1;
  min-width: 0;
}

.prio-palette-sug-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--prio-text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prio-palette-sug-sub {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.15em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prio-palette-sug-snippet {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 0.25em;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prio-palette-sug-course {
  flex-shrink: 0;
  font-size: 0.65rem;
  padding: 0.15em 0.5em;
  border-radius: 4px;
  color: #fff;
  font-weight: 500;
  margin-top: 0.3em;
  opacity: 0.8;
}

/* Palette response area */
.prio-palette-response {
  padding: 1.25em;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.prio-palette-response::-webkit-scrollbar {
  width: 5px;
}

.prio-palette-response::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.prio-palette-response .prio-response-summary {
  color: var(--prio-text-white);
}

.prio-palette-response .prio-note-box {
  background: rgba(209, 3, 158, 0.08);
  color: rgba(255, 255, 255, 0.65);
}

.prio-palette-response .prio-source-link {
  color: var(--prio-brand-light);
  background: rgba(209, 3, 158, 0.08);
  border-color: rgba(209, 3, 158, 0.15);
}

.prio-palette-response .prio-related-chip {
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.prio-palette-response .prio-related-chip:hover {
  color: var(--prio-brand);
  border-color: var(--prio-brand);
  background: rgba(209, 3, 158, 0.1);
}

.prio-palette-response .prio-related-topics-label {
  color: rgba(255, 255, 255, 0.35);
}

.prio-palette-response .prio-skip-btn {
  color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
}

.prio-palette-response .prio-skip-btn:hover {
  color: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Palette empty state */
.prio-palette-empty {
  padding: 2em 1.25em;
  text-align: center;
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.85rem;
}

/* Palette loading */
.prio-palette-loading {
  padding: 2em 1.25em;
  text-align: center;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.85rem;
}

/* Palette footer */
.prio-palette-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5em;
  padding: 0.6em 1.25em;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.prio-palette-hint {
  display: flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.25);
  font-family: var(--prio-font);
}

.prio-palette-hint kbd {
  padding: 0.1em 0.4em;
  font-size: 0.7rem;
  font-family: var(--prio-font);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.35);
}


/* ============================================
   CHAT WIDGET
   ============================================ */

/* Toggle button */
.prio-chat-toggle {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--prio-brand);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--prio-brand-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform var(--prio-transition), box-shadow var(--prio-transition);
}

.prio-chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px var(--prio-brand-glow);
}

.prio-chat-toggle svg {
  width: 26px;
  height: 26px;
  transition: transform 0.3s ease;
}

.prio-chat-toggle.prio-open svg {
  transform: rotate(90deg) scale(0.85);
}

.prio-chat-toggle.prio-pulse {
  animation: prio-pulse-ring 2s ease-out 1;
}

@keyframes prio-pulse-ring {
  0% { box-shadow: 0 4px 16px var(--prio-brand-glow), 0 0 0 0 rgba(209, 3, 158, 0.4); }
  70% { box-shadow: 0 4px 16px var(--prio-brand-glow), 0 0 0 20px rgba(209, 3, 158, 0); }
  100% { box-shadow: 0 4px 16px var(--prio-brand-glow), 0 0 0 0 rgba(209, 3, 158, 0); }
}

/* Chat panel */
.prio-chat-panel {
  position: fixed;
  bottom: 146px;
  right: 20px;
  z-index: 9999;
  width: 380px;
  max-height: 520px;
  background: var(--prio-bg);
  border-radius: var(--prio-radius-lg);
  box-shadow: var(--prio-shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.95);
  opacity: 0;
  visibility: hidden;
  transform-origin: bottom right;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.2s ease,
              visibility 0.2s ease;
}

.prio-chat-panel.prio-active {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

/* Chat header */
.prio-chat-header {
  display: flex;
  align-items: center;
  gap: 0.75em;
  padding: 0.85em 1em;
  background: linear-gradient(135deg, var(--prio-brand), var(--prio-brand-dark));
  color: #fff;
  flex-shrink: 0;
}

.prio-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.prio-chat-header-info {
  flex: 1;
  min-width: 0;
}

.prio-chat-header-title {
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--prio-font);
}

.prio-chat-header-status {
  display: flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.7rem;
  opacity: 0.85;
  font-family: var(--prio-font);
}

.prio-chat-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4caf50;
  display: inline-block;
}

.prio-chat-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 0.25em;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--prio-transition);
}

.prio-chat-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.prio-chat-close svg {
  width: 18px;
  height: 18px;
}

/* Messages area */
.prio-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1em;
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  min-height: 0;
}

.prio-chat-messages::-webkit-scrollbar {
  width: 4px;
}

.prio-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}

/* Message bubbles */
.prio-chat-msg {
  display: flex;
  gap: 0.5em;
  max-width: 88%;
  align-items: flex-end;
}

.prio-chat-msg-bot {
  align-self: flex-start;
}

.prio-chat-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.prio-chat-msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--prio-bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--prio-brand);
  flex-shrink: 0;
}

.prio-chat-msg-user .prio-chat-msg-avatar {
  display: none;
}

.prio-chat-msg-bubble {
  padding: 0.7em 0.9em;
  border-radius: var(--prio-radius);
  font-size: 0.85rem;
  line-height: 1.55;
  font-family: var(--prio-font);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.prio-chat-msg-bot .prio-chat-msg-bubble {
  background: var(--prio-bg-secondary);
  color: var(--prio-text);
  border-bottom-left-radius: 4px;
}

.prio-chat-msg-user .prio-chat-msg-bubble {
  background: var(--prio-brand);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Markdown bold in messages */
.prio-chat-msg-bubble strong {
  font-weight: 600;
}

/* Code in chat messages */
.prio-chat-msg-bubble .prio-code-block {
  margin: 0.6em -0.2em;
}

.prio-chat-msg-bubble .prio-code-block pre {
  font-size: 0.78rem;
  padding: 0.75em;
}

.prio-chat-msg-bubble .prio-source-link {
  margin-top: 0.5em;
  font-size: 0.75rem;
}

.prio-chat-msg-bubble .prio-related-topics {
  margin-top: 0.6em;
}

.prio-chat-msg-bubble .prio-related-chip {
  font-size: 0.72rem;
  padding: 0.2em 0.55em;
}

/* Typing indicator */
.prio-chat-typing {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.5em 0;
  font-size: 0.75rem;
  color: var(--prio-text-light);
  font-family: var(--prio-font);
}

/* Input area */
.prio-chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.65em 0.85em;
  border-top: 1px solid var(--prio-border);
  flex-shrink: 0;
  background: var(--prio-bg);
}

.prio-chat-input {
  flex: 1;
  padding: 0.55em 0.75em;
  border: 1px solid var(--prio-border);
  border-radius: 20px;
  outline: none;
  font-size: 0.85rem;
  font-family: var(--prio-font);
  background: var(--prio-bg-secondary);
  color: var(--prio-text);
  transition: border-color var(--prio-transition);
}

.prio-chat-input:focus {
  border-color: var(--prio-brand);
}

.prio-chat-input::placeholder {
  color: var(--prio-text-light);
}

.prio-chat-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--prio-brand);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--prio-transition), opacity var(--prio-transition);
}

.prio-chat-send:hover {
  transform: scale(1.08);
}

.prio-chat-send:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.prio-chat-send svg {
  width: 16px;
  height: 16px;
}


/* ============================================
   ASK PAGE
   ============================================ */

/* Hero */
.prio-ask-hero {
  text-align: center;
  padding: 3.5em 2em 2em;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.prio-ask-hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--prio-text);
  margin: 0 0 0.35em;
  font-family: var(--prio-font);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.prio-ask-hero h1 .prio-gradient-text {
  background: linear-gradient(135deg, var(--prio-brand) 0%, #7c3aed 50%, var(--prio-brand-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  animation: prio-gradient-shift 4s ease-in-out infinite;
}

@keyframes prio-gradient-shift {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

.prio-ask-hero p {
  font-size: 1.05rem;
  color: var(--prio-text-secondary);
  margin: 0 0 2em;
  font-family: var(--prio-font);
  line-height: 1.6;
}

/* Badge */
.prio-ask-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.45em 1.1em;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--prio-font);
  color: var(--prio-brand);
  background: linear-gradient(135deg, rgba(209, 3, 158, 0.08), rgba(124, 58, 237, 0.08));
  border: 1px solid rgba(209, 3, 158, 0.15);
  border-radius: 20px;
  margin-bottom: 1.25em;
  letter-spacing: 0.03em;
  animation: prio-badge-pulse 3s ease-in-out infinite;
}

@keyframes prio-badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(209, 3, 158, 0); }
  50% { box-shadow: 0 0 0 6px rgba(209, 3, 158, 0.06); }
}

.prio-ask-badge i {
  font-size: 0.8rem;
}

.prio-ask-badge.prio-semantic-ready {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(59, 130, 246, 0.12));
  border-color: rgba(16, 185, 129, 0.3);
  color: #059669;
}

[data-theme="dark"] .prio-ask-badge.prio-semantic-ready {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(59, 130, 246, 0.15));
  color: #34d399;
}

/* Large search input */
.prio-ask-search-wrap {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.prio-ask-search-icon {
  position: absolute;
  left: 1.4em;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.05rem;
  color: var(--prio-text-light);
  pointer-events: none;
  transition: color var(--prio-transition);
}

.prio-ask-search-wrap:focus-within .prio-ask-search-icon {
  color: var(--prio-brand);
}

.prio-ask-search-input {
  width: 100%;
  padding: 1.1em 4em 1.1em 3.5em;
  font-size: 1.05rem;
  font-family: var(--prio-font);
  border: 2px solid var(--prio-border);
  border-radius: 50px;
  background: var(--prio-bg);
  color: var(--prio-text);
  outline: none;
  transition: all var(--prio-transition);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}

.prio-ask-search-input:focus {
  border-color: var(--prio-brand);
  box-shadow: 0 4px 30px var(--prio-brand-glow), 0 0 0 4px rgba(209, 3, 158, 0.06);
}

.prio-ask-search-input::placeholder {
  color: var(--prio-text-light);
}

/* Search button */
.prio-ask-search-btn {
  position: absolute;
  right: 0.5em;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--prio-brand), #7c3aed);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all var(--prio-transition);
  box-shadow: 0 2px 8px rgba(209, 3, 158, 0.3);
}

.prio-ask-search-btn:hover {
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 4px 16px rgba(209, 3, 158, 0.4);
}

/* Hint text */
.prio-ask-hint {
  font-size: 0.78rem;
  color: var(--prio-text-light);
  margin-top: 0.85em;
  font-family: var(--prio-font);
}

.prio-ask-hint kbd {
  padding: 0.15em 0.45em;
  font-size: 0.72rem;
  font-family: var(--prio-font-mono);
  background: var(--prio-bg-secondary);
  border: 1px solid var(--prio-border);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Suggested questions */
.prio-ask-suggestions {
  max-width: 1100px;
  margin: 2.5em auto 0;
  padding: 0 2em;
}

.prio-ask-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--prio-text-light);
  margin-bottom: 1.2em;
  font-family: var(--prio-font);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.prio-ask-section-title i {
  font-size: 0.85rem;
  color: var(--prio-brand);
}

.prio-ask-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1em;
}

.prio-ask-card {
  padding: 1.25em;
  background: var(--prio-bg);
  border: 1px solid var(--prio-border);
  border-radius: var(--prio-radius);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  font-family: var(--prio-font);
  position: relative;
  overflow: hidden;
}

.prio-ask-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--prio-brand));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.prio-ask-card:hover {
  border-color: transparent;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(-3px);
}

.prio-ask-card:hover::before {
  opacity: 1;
}

.prio-ask-card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.03);
}

.prio-ask-card-text {
  font-size: 0.88rem;
  color: var(--prio-text);
  font-weight: 500;
  line-height: 1.4;
}

.prio-ask-card:hover .prio-ask-card-text {
  color: var(--prio-brand);
}

/* Trending topics */
.prio-ask-trending {
  max-width: 1100px;
  margin: 2em auto 0;
  padding: 0 2em 3em;
}

.prio-ask-trending-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em;
}

.prio-ask-trending-chip {
  padding: 0.5em 1em;
  font-size: 0.8rem;
  color: var(--prio-text-secondary);
  background: var(--prio-bg);
  border: 1px solid var(--prio-border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--prio-font);
  white-space: nowrap;
  font-weight: 500;
}

.prio-ask-trending-chip:hover {
  color: #fff;
  border-color: var(--prio-brand);
  background: linear-gradient(135deg, var(--prio-brand), #7c3aed);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(209, 3, 158, 0.25);
}

/* Response area */
.prio-ask-response {
  max-width: 1100px;
  margin: 2em auto 0;
  padding: 0 2em;
  display: none;
}

.prio-ask-response.prio-active {
  display: block;
  animation: prio-fade-up 0.4s ease-out;
}

@keyframes prio-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Response card header */
.prio-ask-response-header {
  display: flex;
  align-items: center;
  gap: 0.65em;
  margin-bottom: 1em;
  padding-bottom: 0.85em;
  border-bottom: 1px solid var(--prio-border);
}

.prio-ask-response-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--prio-brand), #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.prio-ask-response-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--prio-text);
  font-family: var(--prio-font);
}

.prio-ask-response-label span {
  font-weight: 400;
  color: var(--prio-text-light);
  font-size: 0.75rem;
  margin-left: 0.5em;
}

.prio-ask-response-card {
  padding: 1.5em 1.75em;
  background: var(--prio-bg);
  border: 1px solid var(--prio-border);
  border-radius: var(--prio-radius-lg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
  position: relative;
}

.prio-ask-response-card .prio-response-summary {
  color: var(--prio-text);
}

/* Typing indicator */
.prio-ask-typing {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 1em 0;
}

.prio-ask-typing-dots {
  display: flex;
  gap: 4px;
}

.prio-ask-typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--prio-brand);
  opacity: 0.4;
  animation: prio-typing-bounce 1.2s ease-in-out infinite;
}

.prio-ask-typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.prio-ask-typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes prio-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.prio-ask-typing-text {
  font-size: 0.8rem;
  color: var(--prio-text-light);
  font-family: var(--prio-font);
}

/* Follow-up input */
.prio-ask-followup {
  max-width: 1100px;
  margin: 1.5em auto 0;
  padding: 0 2em 3em;
  display: none;
}

.prio-ask-followup.prio-active {
  display: block;
}

.prio-ask-followup-input {
  width: 100%;
  padding: 1em 1.5em;
  font-size: 0.95rem;
  font-family: var(--prio-font);
  border: 2px solid var(--prio-border);
  border-radius: 50px;
  background: var(--prio-bg);
  color: var(--prio-text);
  outline: none;
  transition: all var(--prio-transition);
  box-sizing: border-box;
}

.prio-ask-followup-input:focus {
  border-color: var(--prio-brand);
  box-shadow: 0 4px 20px var(--prio-brand-glow);
}

.prio-ask-followup-input::placeholder {
  color: var(--prio-text-light);
}

/* Recent searches */
.prio-ask-recent {
  max-width: 1100px;
  margin: 2em auto 0;
  padding: 0 2em 3em;
}

.prio-ask-recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.prio-ask-recent-item {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.5em 0.75em;
  border-radius: var(--prio-radius-sm);
  cursor: pointer;
  transition: background var(--prio-transition);
  font-size: 0.85rem;
  color: var(--prio-text-secondary);
  font-family: var(--prio-font);
}

.prio-ask-recent-item:hover {
  background: var(--prio-bg-secondary);
  color: var(--prio-text);
}

.prio-ask-recent-item::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E");
  background-size: contain;
  flex-shrink: 0;
  opacity: 0.6;
}

.prio-ask-recent-clear {
  background: none;
  border: none;
  color: var(--prio-text-light);
  font-size: 0.75rem;
  cursor: pointer;
  font-family: var(--prio-font);
  padding: 0.3em 0.5em;
  transition: color var(--prio-transition);
}

.prio-ask-recent-clear:hover {
  color: var(--prio-brand);
}

.prio-ask-recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5em;
}


/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .prio-palette {
    max-width: calc(100vw - 2em);
    margin: 0 1em;
  }

  .prio-ask-hero h1 {
    font-size: 1.75rem;
  }

  .prio-ask-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .prio-palette-overlay {
    padding-top: 0;
    align-items: stretch;
  }

  .prio-palette {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    max-height: 100vh;
    height: 100vh;
  }

  .prio-chat-panel {
    width: 100%;
    height: calc(100vh - 40px);
    max-height: none;
    bottom: 0;
    right: 0;
    border-radius: var(--prio-radius-lg) var(--prio-radius-lg) 0 0;
  }

  .prio-ask-cards-grid {
    grid-template-columns: 1fr;
  }

  .prio-ask-hero {
    padding-top: 2em;
  }

  .prio-ask-hero h1 {
    font-size: 1.5rem;
  }
}


/* ============================================
   DARK MODE OVERRIDES
   ============================================ */

[data-theme="dark"] .prio-chat-msg-bot .prio-chat-msg-bubble {
  background: #2a2a2a;
}

[data-theme="dark"] .prio-chat-input {
  background: #1e1e1e;
  border-color: rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
}

[data-theme="dark"] .prio-chat-input-wrap {
  background: var(--prio-bg);
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .prio-ask-card {
  background: #1e1e1e;
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .prio-ask-search-input {
  background: #1e1e1e;
  border-color: rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
}

[data-theme="dark"] .prio-ask-response-card {
  background: #1e1e1e;
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .prio-ask-followup-input {
  background: #1e1e1e;
  border-color: rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
}

[data-theme="dark"] .prio-ask-trending-chip {
  background: #1e1e1e;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .prio-chat-msg-avatar {
  background: #2a2a2a;
}

[data-theme="dark"] .prio-ask-badge {
  background: linear-gradient(135deg, rgba(209, 3, 158, 0.15), rgba(124, 58, 237, 0.15));
  border-color: rgba(209, 3, 158, 0.2);
}

[data-theme="dark"] .prio-ask-card-icon {
  background: rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .prio-ask-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .prio-ask-trending-chip:hover {
  box-shadow: 0 4px 12px rgba(209, 3, 158, 0.3);
}

[data-theme="dark"] .prio-ask-response-header {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
