/* ============================================================================
   Evotic — /assistance page (Phase 11.0b)
   Chat UI : header + quick action chips + chat scroll + composer fixed
   ============================================================================ */

.ast-body {
  padding: 0;
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(circle at 100% 0%, rgba(124, 58, 237, 0.06), transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(255, 102, 0, 0.05), transparent 50%);
  background-attachment: fixed;
}

/* App-header */
.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-top);
  box-shadow: var(--shadow-header);
}
.app-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-4);
}
.app-header-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}
.app-header-name {
  font-size: 17px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-header-sub {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.hdr-back {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  flex-shrink: 0;
  transition: background var(--t-fast), transform var(--t-fast);
}
.hdr-back:hover { background: var(--skeleton); }
.hdr-back:active { transform: scale(0.92); }

/* ─────────────────────────────────────────────────────────────────
   Quick action chips — horizontal scroll
   ───────────────────────────────────────────────────────────────── */
.ast-quick {
  display: flex;
  gap: 6px;
  padding: var(--sp-3) var(--sp-4);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}
.ast-quick::-webkit-scrollbar { display: none; }

.ast-qbtn {
  width: auto;
  margin: 0;
  padding: 8px 14px;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 800;
  background: var(--primary-bg);
  color: var(--primary-dark);
  border: 1.5px solid transparent;
  border-radius: var(--r-pill);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.01em;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.ast-qbtn:hover { background: var(--primary); color: #fff; }
.ast-qbtn:active { transform: scale(0.95); }
.ast-qbtn-med {
  background: linear-gradient(135deg, #E0F2F1, #B2DFDB);
  color: #00695C;
}
.ast-qbtn-med:hover { background: #00897B; color: #fff; }

/* ─────────────────────────────────────────────────────────────────
   Chat scroll area
   ───────────────────────────────────────────────────────────────── */
.ast-chat-wrap {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ast-chat {
  list-style: none;
  padding: var(--sp-4);
  padding-bottom: calc(72px + var(--safe-bottom) + var(--sp-4));
  margin: 0 auto;
  max-width: var(--max-w);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.ast-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: astMsgIn 0.22s ease-out;
}
@keyframes astMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ast-msg-user {
  flex-direction: row-reverse;
}
.ast-msg-user .ast-bubble {
  background: var(--primary-grad);
  color: #fff;
  border-radius: var(--r-xl) var(--r-xl) var(--r-xs) var(--r-xl);
  box-shadow: var(--shadow-primary-sm);
}
.ast-msg-bot .ast-bubble {
  background: var(--card-bg);
  color: var(--text);
  border-radius: var(--r-xl) var(--r-xl) var(--r-xl) var(--r-xs);
  box-shadow: var(--shadow-card);
}

.ast-bubble {
  max-width: 80%;
  padding: 10px 14px;
  font-size: 14.5px;
  line-height: 1.5;
  word-wrap: break-word;
  font-weight: 600;
}
.ast-bubble strong { font-weight: 900; }
.ast-bubble a.ast-tel {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 4px 4px 0 0;
  padding: 4px 10px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--r-pill);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.ast-msg-user .ast-bubble a.ast-tel {
  background: #fff;
  color: var(--primary-dark);
}

.ast-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-bg);
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.ast-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Typing dots */
.ast-typing .ast-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
}
.ast-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  animation: astDot 1.2s ease-in-out infinite;
}
.ast-dot:nth-child(2) { animation-delay: 0.18s; }
.ast-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes astDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30%           { opacity: 1; transform: translateY(-3px); }
}

/* ─────────────────────────────────────────────────────────────────
   Composer (fixed bottom)
   ───────────────────────────────────────────────────────────────── */
.ast-composer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3);
  padding-bottom: max(var(--sp-3), calc(var(--safe-bottom) + var(--sp-3)));
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  z-index: var(--z-header);
  max-width: var(--max-w);
  margin: 0 auto;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.05);
}
@media (min-width: 640px) {
  .ast-composer {
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  }
}

.ast-input {
  flex: 1;
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--border-strong);
  background: var(--card-bg);
  color: var(--text);
  font-size: 14.5px;
  font-family: var(--font);
  font-weight: 600;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.ast-input::placeholder { color: var(--text-faint); font-weight: 500; }
.ast-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--primary-bg-soft);
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.10);
}

.ast-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--primary-grad);
  color: #fff;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  box-shadow: var(--shadow-primary-sm);
  transition: transform var(--t-fast), box-shadow var(--t-base);
}
.ast-send-btn:hover:not(:disabled) {
  box-shadow: var(--shadow-primary);
  transform: scale(1.04);
}
.ast-send-btn:active:not(:disabled) { transform: scale(0.92); }
.ast-send-btn:disabled {
  background: var(--skeleton-strong);
  color: var(--text-faint);
  box-shadow: none;
  cursor: not-allowed;
}
