/* Ask Mira — data agent chat page */

.am-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px 20px 8px;
  position: relative;
}

.am-topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.am-new-btn {
  border: 1px solid #d7d7de;
  background: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.am-new-btn:hover { background: #f5f5f7; }

/* Landing */
.am-landing { text-align: center; padding: 32px 0 8px; }
.am-greeting { font-size: 26px; font-weight: 650; margin: 8px 0 6px; }
.am-sub { color: #6b6b76; max-width: 560px; margin: 0 auto 22px; }
.am-chips {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  max-width: 680px; margin: 0 auto 28px;
}
.am-chip {
  border: 1px solid #e2e2e8; background: #fafafb; border-radius: 14px;
  padding: 10px 14px; font-size: 13px; color: #333; cursor: pointer; text-align: left;
}
.am-chip:hover { background: #f0f0f4; border-color: #cfcfd8; }

.am-history-label {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: #9a9aa4; margin: 18px 0 8px;
}
.am-history { display: flex; flex-direction: column; gap: 6px; }
.am-hist-item {
  display: flex; justify-content: space-between; align-items: center;
  border: 1px solid #ececf1; background: #fff; border-radius: 8px;
  padding: 10px 12px; cursor: pointer; text-align: left; width: 100%;
}
.am-hist-item:hover { background: #f7f7f9; }
.am-hist-title { font-size: 14px; color: #26262c; }
.am-hist-date { font-size: 12px; color: #a0a0aa; }
.am-empty { color: #9a9aa4; font-size: 13px; padding: 6px 0; }

/* Thread */
.am-thread-wrap { margin-top: 8px; }
.am-thread { display: flex; flex-direction: column; gap: 14px; }
.am-msg { border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.5; }
.am-user { align-self: flex-end; background: #eef1ff; max-width: 78%; }
.am-assistant { align-self: flex-start; background: #f6f6f8; width: 100%; }
.am-error { align-self: flex-start; background: #fdecec; color: #8a1c1c; }
.am-thinking { color: #8a8a94; font-style: italic; }

/* Live progress checklist */
.am-pending { display: flex; flex-direction: column; gap: 4px; }
.am-step { display: flex; align-items: center; gap: 7px; font-size: 13px; line-height: 1.4; }
.am-step-done { color: #9a9aa4; }
.am-step-done .am-step-check { color: #7AC020; font-weight: 700; }
.am-step-active { color: #26262c; }
.am-step-timer {
  margin-left: 6px; color: #b0b0b8; font-size: 12px;
  font-variant-numeric: tabular-nums; min-width: 2.5em;
}
.am-dots::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: am-dots 1.4s steps(1, end) infinite;
}
@keyframes am-dots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
  100% { content: ""; }
}
.am-md p:last-child { margin-bottom: 0; }
.am-md table { border-collapse: collapse; margin: 8px 0; }
.am-md th, .am-md td { border: 1px solid #e2e2e8; padding: 4px 8px; font-size: 13px; }
.am-artifact { margin-top: 10px; }
/* charts sit directly on the bubble (no nested box); tables get a light frame */
.am-chart { }
.am-table-wrap { background: #fff; border: 1px solid #ececf1; border-radius: 8px; padding: 6px; overflow: auto; }
.am-table { width: 100%; }

/* Input bar — sticky within the content column (respects the nav rail), so it
   stays aligned with the messages instead of centering on the whole viewport. */
.am-inputbar {
  position: sticky; bottom: 0;
  display: flex; gap: 8px; align-items: stretch;   /* button matches textarea height */
  padding: 12px 0 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 22%);
}
.am-input {
  flex: 1; resize: none; border: 1px solid #d7d7de; border-radius: 10px;
  padding: 10px 12px; font-size: 14px; font-family: inherit; min-height: 46px;
}
.am-send-btn {
  border: none; background: #3b5bdb; color: #fff; border-radius: 10px;
  padding: 0 22px; font-size: 14px; cursor: pointer;
}
.am-send-btn:hover { background: #2f4bc4; }
