/* mhp-intelligence/src/static/ask-apto.css
 *
 * Self-contained on purpose. Three of the four review pages link
 * dify-theme.css, but src/salesforce_view/api.py styles itself inline — so every
 * token here falls back to the theme's literal value rather than assuming the
 * custom properties exist.
 */
:root {
  --aa-primary: var(--btn-primary-bg, #9A25AE);
  --aa-primary-hover: var(--btn-primary-bg-hover, #c629ff);
  --aa-ink: var(--text-primary, #101828);
  --aa-ink-2: var(--text-secondary, #354052);
  --aa-muted: #676f83;
  --aa-line: var(--divider-regular, rgb(16 24 40 / 0.08));
  --aa-page: var(--background-body, #f2f4f7);
  --aa-panel: var(--panel-bg, #ffffff);
  --aa-tint: var(--workflow-topbar-bg, #F5E9F7);
  --aa-danger: var(--btn-destructive-bg, #d92d20);
  --aa-radius: var(--radius-lg, 10px);
  --aa-shadow: var(--shadow-md, 0 2px 4px -2px rgba(16,24,40,.06), 0 4px 8px -2px rgba(16,24,40,.10));
  --aa-font: var(--font-sans, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif);
  --aa-width: 400px;
}

#aa-tab {
  position: fixed; right: 0; top: 42%; z-index: 2147483000;
  width: 44px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  background: var(--aa-panel);
  border: 1px solid var(--aa-line); border-right: 0;
  border-radius: var(--aa-radius) 0 0 var(--aa-radius);
  box-shadow: -2px 2px 8px rgb(16 24 40 / .08);
  cursor: pointer; transition: transform .16s ease, box-shadow .16s ease;
}
#aa-tab:hover { transform: translateX(-2px); box-shadow: -4px 2px 12px rgb(16 24 40 / .12); }
#aa-tab[data-dragging="true"] { transition: none; cursor: grabbing; }

#aa-tip {
  position: fixed; z-index: 2147483001;
  background: var(--aa-ink); color: #fff;
  font: 500 12px/1 var(--aa-font);
  padding: 6px 9px; border-radius: 6px;
  opacity: 0; pointer-events: none; transition: opacity .12s ease;
}
#aa-tip[data-show="true"] { opacity: 1; }

#aa-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 2147483000;
  width: var(--aa-width); max-width: 100vw;
  display: flex; flex-direction: column;
  background: var(--aa-panel);
  border-left: 1px solid var(--aa-line);
  box-shadow: var(--aa-shadow);
  font-family: var(--aa-font);
  transform: translateX(100%); transition: transform .22s cubic-bezier(.4,0,.2,1);
}
#aa-panel[data-open="true"] { transform: translateX(0); }
#aa-panel[data-wide="true"] { width: min(920px, 96vw); }

.aa-head {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px; border-bottom: 1px solid var(--aa-line);
}
.aa-glyph {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: linear-gradient(145deg, var(--aa-primary), var(--aa-primary-hover));
  display: flex; align-items: center; justify-content: center;
}
.aa-title { font-size: 14px; font-weight: 600; color: var(--aa-ink); }
.aa-head-btns { margin-left: auto; display: flex; gap: 8px; }
.aa-icon-btn {
  border: 0; cursor: pointer;
  background: var(--aa-primary); color: #fff;
  font-size: 9px; line-height: 1;
  width: 14px; height: 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  /* Hit area is larger than the visual circle so the click target doesn't
     shrink along with the glyph — the circles are small on purpose (macOS
     traffic-light scale), the tap target isn't. */
  position: relative;
}
.aa-icon-btn::before {
  content: ""; position: absolute; inset: -6px;
}
.aa-icon-btn:hover { background: var(--aa-primary-hover); }

.aa-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.aa-msg { font-size: 13px; line-height: 1.5; color: var(--aa-ink-2); }
.aa-msg.aa-me {
  align-self: flex-end; max-width: 84%;
  background: var(--aa-tint); color: var(--aa-ink-2);
  padding: 8px 11px; border-radius: 11px 11px 3px 11px;
}
.aa-label { font-size: 10px; letter-spacing: .4px; text-transform: uppercase; color: var(--aa-muted); }

.aa-chip {
  display: inline-block; margin: 3px 4px 0 0; cursor: pointer;
  font-size: 12px; color: var(--aa-primary);
  border: 1px solid rgb(154 37 174 / .35); background: rgb(154 37 174 / .05);
  border-radius: 999px; padding: 5px 10px;
}
.aa-chip:hover { background: rgb(154 37 174 / .12); }

.aa-scroll { overflow-x: auto; }
.aa-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.aa-table th {
  text-align: left; font-weight: 600; color: var(--aa-muted);
  background: var(--aa-page); padding: 6px 8px;
  border-bottom: 1px solid var(--aa-line); white-space: nowrap;
}
.aa-table td {
  padding: 6px 8px; color: var(--aa-ink-2);
  border-bottom: 1px solid rgb(16 24 40 / .05); white-space: nowrap;
}
.aa-soql {
  font-size: 11px; color: var(--aa-muted);
}
/* Text-link button: "Show 30 more" sits beside "view query" and reads the same. */
.aa-link {
  display: block; margin: 6px 0 2px; padding: 0; border: 0; background: none;
  cursor: pointer; font: 11px var(--aa-font); color: var(--aa-primary);
}
.aa-link:hover { text-decoration: underline; }

/* The PDF download: the same purple gradient as the chat icon, quiet shadow,
   small lift on hover. */
.aa-export { margin: 10px 0 4px; display: flex; flex-wrap: wrap; gap: 8px; }
.aa-export-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  height: 32px; padding: 0 16px; border: 0; border-radius: 999px;
  font: 600 12px/1 var(--aa-font); letter-spacing: .1px; color: #fff;
  background: linear-gradient(145deg, var(--aa-primary), var(--aa-primary-hover));
  box-shadow: 0 1px 2px rgb(154 37 174 / .30), 0 4px 12px rgb(154 37 174 / .18);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.aa-export-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgb(154 37 174 / .32), 0 8px 18px rgb(154 37 174 / .24);
}
.aa-export-btn:active { transform: translateY(0); }
.aa-export-btn:disabled { opacity: .65; cursor: progress; transform: none; }
.aa-export-btn svg { flex: none; }
.aa-export .aa-label { flex-basis: 100%; margin-top: 0; text-transform: none; letter-spacing: 0; font-size: 11px; }
/* "Which one do you mean?" -- one pill per candidate, a click asks about it. */
.aa-choices { margin: 10px 0 4px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.aa-choice {
  cursor: pointer; padding: 8px 14px; border-radius: 12px; text-align: left;
  font: 500 13px/1.3 var(--aa-font); color: var(--aa-primary);
  background: #fff; border: 1px solid rgb(154 37 174 / .35);
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
.aa-choice:hover:not(:disabled) { background: rgb(154 37 174 / .07); border-color: var(--aa-primary); transform: translateX(2px); }
.aa-choice.aa-choice-picked { background: rgb(154 37 174 / .10); border-color: var(--aa-primary); }
.aa-choices-done .aa-choice:not(.aa-choice-picked) { cursor: default; opacity: .55; }
/* the candidates as a table: rows light up and click */
.aa-choices { align-items: stretch; }
.aa-pick-row { cursor: pointer; }
.aa-pick-row:hover td, .aa-pick-row:focus td { background: rgb(154 37 174 / .07); }
.aa-pick-row:focus { outline: none; }
.aa-pick-row.aa-choice-picked td { background: rgb(154 37 174 / .12); font-weight: 600; }
.aa-choices-done .aa-pick-row:not(.aa-choice-picked) { cursor: default; opacity: .55; }
.aa-choices-done .aa-pick-row:not(.aa-choice-picked):hover td { background: none; }
.aa-choices .aa-label { margin-top: 4px; text-transform: none; letter-spacing: 0; font-size: 11px; }
.aa-soql summary { cursor: pointer; color: var(--aa-primary); }
.aa-soql pre {
  margin: 6px 0 0; padding: 8px; overflow-x: auto;
  background: var(--aa-page); border-radius: 6px;
  font-family: var(--font-mono, ui-monospace, Menlo, monospace); font-size: 11px;
  color: var(--aa-ink-2);
}

.aa-steps {
  font-size: 11px; color: var(--aa-muted); margin-bottom: 6px;
}
.aa-steps summary { cursor: pointer; color: var(--aa-primary); }
.aa-steps ul {
  margin: 6px 0 0; padding-left: 16px; list-style: disc;
}
.aa-steps li { margin: 2px 0; color: var(--aa-ink-2); }

.aa-foot { border-top: 1px solid var(--aa-line); padding: 10px; display: flex; gap: 8px; }
.aa-input {
  flex: 1; font: 13px var(--aa-font); color: var(--aa-ink);
  border: 1px solid rgb(16 24 40 / .14); border-radius: 8px;
  padding: 9px 11px; resize: none; max-height: 96px;
}
.aa-input:focus { outline: 2px solid rgb(154 37 174 / .28); outline-offset: -1px; }
.aa-send {
  width: 34px; height: 34px; flex: none; cursor: pointer;
  border: 0; border-radius: 8px; color: #fff; font-size: 15px;
  background: var(--aa-primary);
}
.aa-send:hover { background: var(--aa-primary-hover); }
.aa-send:disabled { opacity: .5; cursor: default; }

.aa-welcome-title { font-size: 15px; font-weight: 700; color: var(--aa-ink); letter-spacing: -.1px; }
.aa-welcome-text { margin-top: 4px; font-size: 13px; line-height: 1.5; color: var(--aa-muted); }

.aa-dots span {
  display: inline-block; width: 5px; height: 5px; margin-right: 3px;
  border-radius: 50%; background: var(--aa-primary); opacity: .35;
  animation: aa-pulse 1.1s infinite;
}
.aa-dots span:nth-child(2) { animation-delay: .15s; }
.aa-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes aa-pulse { 0%,100% { opacity: .25 } 50% { opacity: .9 } }

/* Waiting for an answer: live status, timer, the last few real steps, a tip to click. */
.aa-wait { display: flex; flex-direction: column; gap: 10px; min-width: 240px; }
.aa-wait-head { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--aa-ink-2); }
.aa-wait-status { flex: 1; font-weight: 600; }
.aa-wait-time { font-variant-numeric: tabular-nums; font-size: 11px; color: var(--aa-muted); }
.aa-orb {
  flex: none; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e9b3f2, var(--aa-primary));
  animation: aa-orb 1.6s ease-in-out infinite;
}
@keyframes aa-orb {
  0%, 100% { transform: scale(.85); box-shadow: 0 0 0 0 rgb(154 37 174 / .35); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 7px rgb(154 37 174 / 0); }
}
.aa-wait-status.aa-status-in { animation: aa-step-in .25s ease both; }
.aa-wait-note { font-size: 11px; color: var(--aa-muted); }
.aa-wait-note:empty { display: none; }
.aa-wait-bar { height: 3px; border-radius: 3px; overflow: hidden; background: rgb(154 37 174 / .12); }
.aa-wait-bar span {
  display: block; height: 100%; width: 40%; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--aa-primary), transparent);
  animation: aa-slide 1.4s ease-in-out infinite;
}
@keyframes aa-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.aa-wait-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.aa-wait-steps:empty { display: none; }
.aa-wait-steps li {
  font-size: 12px; color: var(--aa-muted); padding-left: 16px; position: relative;
  animation: aa-step-in .25s ease both;
}
.aa-wait-steps li::before { content: "\2713"; position: absolute; left: 0; color: var(--aa-primary); font-weight: 700; }
@keyframes aa-step-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.aa-wait-tip {
  text-align: left; cursor: pointer; font: 400 12px/1.45 var(--aa-font); color: var(--aa-ink-2);
  padding: 9px 12px; border-radius: 10px; border: 1px solid rgb(154 37 174 / .18);
  background: rgb(154 37 174 / .05); transition: background .12s ease, border-color .12s ease;
}
.aa-wait-tip:hover { background: rgb(154 37 174 / .09); border-color: rgb(154 37 174 / .35); }
.aa-wait-tip strong { color: var(--aa-primary); }
.aa-wait-tip.aa-tip-in { animation: aa-step-in .3s ease both; }
@media (prefers-reduced-motion: reduce) {
  .aa-orb, .aa-wait-bar span, .aa-wait-steps li, .aa-wait-tip.aa-tip-in { animation: none; }
}

.aa-card {
  border: 1px solid var(--aa-line); border-radius: 9px; overflow: hidden;
}
.aa-card-head {
  font-size: 12px; font-weight: 600; padding: 7px 10px;
  background: var(--aa-page); color: var(--aa-ink-2);
  border-bottom: 1px solid var(--aa-line);
}
.aa-card.aa-danger .aa-card-head {
  background: #fef3f2; color: var(--aa-danger);
  border-bottom-color: rgb(217 45 32 / .2);
}
.aa-diff {
  padding: 8px 10px; font-size: 12px;
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
}
.aa-diff .aa-del { color: var(--aa-danger); display: block; }
.aa-diff .aa-add { color: #166534; display: block; }
.aa-card-note {
  padding: 0 10px 8px; font-size: 12px; color: var(--aa-ink-2); font-family: var(--aa-font);
}
.aa-card-actions {
  display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--aa-line);
}
.aa-btn {
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 7px;
  cursor: pointer; border: 1px solid transparent; font-family: var(--aa-font);
}
.aa-btn-primary { background: var(--aa-primary); color: #fff; }
.aa-btn-primary:hover { background: var(--aa-primary-hover); }
.aa-btn-danger { background: var(--aa-danger); color: #fff; }
.aa-btn-secondary { background: #fff; border-color: rgb(16 24 40 / .14); color: var(--aa-ink-2); }
.aa-btn:disabled { opacity: .5; cursor: default; }

@media (max-width: 640px) {
  #aa-panel { width: 100vw; }
}
