/* Ask — "Ask anything" chat page */

.ask-shell {
  padding: 48px 0 72px;
  min-height: calc(100vh - var(--header-height, 73px));
}

.ask-container {
  max-width: 840px;
}

.ask-head {
  text-align: center;
  margin-bottom: 28px;
}

.ask-head .eyebrow {
  display: inline-block;
  margin-bottom: 10px;
}

.ask-head h1 {
  font-family: var(--font-display);
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 12px;
}

.ask-head p {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 560px;
  margin: 0 auto;
}

/* Card */
.ask-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Gate (signed out / error) */
.ask-gate {
  padding: 64px 32px;
  text-align: center;
}

.ask-gate-icon {
  font-size: 44px;
  margin-bottom: 16px;
}

.ask-gate h2 {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text);
  margin: 0 0 10px;
}

.ask-gate p {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 420px;
  margin: 0 auto 24px;
}

.ask-gate-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Chat */
.ask-chat {
  display: flex;
  flex-direction: column;
  height: min(620px, calc(100vh - 260px));
  min-height: 420px;
}

.ask-chat-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.ask-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
  flex-shrink: 0;
}

.ask-chat-title {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  flex: 1;
}

.ask-quota {
  font-size: 12px;
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
}

.ask-clear-btn {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.ask-clear-btn:hover {
  color: var(--text);
  border-color: var(--primary-2);
}

.ask-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
}

/* Empty state */
.ask-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 24px 0;
}

.ask-empty-icon {
  font-size: 34px;
  display: block;
  margin-bottom: 12px;
}
.ask-empty p {
  font-size: 14px;
  margin: 0 0 18px;
}

.ask-suggestions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
}

.ask-suggestion {
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.ask-suggestion:hover {
  border-color: var(--primary-2);
  transform: translateY(-1px);
}

/* Messages */
.ask-msg {
  display: flex;
}
.ask-msg.user {
  justify-content: flex-end;
}
.ask-msg.assistant {
  justify-content: flex-start;
}

.ask-bubble {
  max-width: 82%;
  padding: 13px 16px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.ask-msg.user .ask-bubble {
  background: var(--gradient);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.ask-msg.assistant .ask-bubble {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 6px;
}

.ask-bubble.is-error {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--text);
}

.ask-caret {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--accent);
  border-radius: 2px;
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: ask-blink 1s steps(2) infinite;
}

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

/* Input */
.ask-input {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.ask-input textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  max-height: 200px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ask-input textarea:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(109, 94, 242, 0.15);
}

.ask-input textarea::placeholder {
  color: var(--text-subtle);
}

.ask-input .btn {
  align-self: flex-end;
}

/* Responsive */
@media (max-width: 640px) {
  .ask-head h1 {
    font-size: 28px;
  }
  .ask-bubble {
    max-width: 92%;
  }
}
