/* 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);
}
.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-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-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 } }

.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; }
}
