/* CARD3D Flow assistant (2026-10-31): the "Ask" button in the top bar and its panel */
.ask-btn { gap: 6px; }
.ask-btn svg { width: 16px; height: 16px; }
.ask-btn.on { background: var(--teal-wash); color: var(--teal-deep); }

.agent-panel { position: fixed; top: 68px; right: max(16px, calc((100vw - var(--maxw)) / 2 + 16px)); z-index: 35;
  width: min(400px, calc(100vw - 32px)); max-height: calc(100svh - 88px); display: flex; flex-direction: column;
  background: var(--sheet); border: 1px solid var(--crease); border-radius: 14px; box-shadow: 0 18px 48px rgba(16, 43, 69, .18); overflow: hidden; }
.agent-panel[hidden] { display: none; }
.agent-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 16px; border-bottom: 1px dashed var(--crease); }
.agent-head h2 { flex: 1; margin: 0; font-family: var(--serif); font-weight: 400; font-size: 1.35rem; color: var(--ink); }
.agent-x { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; font-size: 1.4rem; line-height: 1; color: var(--ink-soft); cursor: pointer; }
.agent-x:hover { background: var(--crease-soft); }

.agent-intro { padding: 14px 16px 6px; overflow-y: auto; }
.agent-intro p { margin: 0 0 10px; color: var(--ink-soft); font-size: .93rem; line-height: 1.45; }
.agent-examples { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.agent-examples .chip { text-align: left; }

.agent-log { flex: 1; min-height: 80px; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.agent-msg { max-width: 88%; padding: 8px 12px; border-radius: 12px; font-size: .93rem; line-height: 1.45; }
.agent-msg p { margin: 0; }
.agent-msg p + p { margin-top: 4px; }
.agent-msg.you { align-self: flex-end; background: var(--teal); color: #fff; border-bottom-right-radius: 4px; }
.agent-msg.agent { align-self: flex-start; background: var(--paper); border: 1px solid var(--crease-soft); color: var(--ink); border-bottom-left-radius: 4px; }
.agent-msg.error { border-color: var(--danger); color: var(--danger); }
.agent-msg.busy { color: var(--ink-faint); font-style: italic; }
.agent-msg .btn.small { margin-top: 6px; min-height: 30px; padding: 4px 10px; }
.agent-note { font-size: .85rem; color: var(--ink-soft); }
.agent-team { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.agent-team-note { width: 100%; box-sizing: border-box; font: inherit; font-size: .88rem; padding: 6px 8px; border: 1px solid var(--crease); border-radius: 8px; resize: vertical; }
.agent-team .btn { align-self: flex-start; }

.agent-input { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px dashed var(--crease); }
.agent-input textarea { flex: 1; font: inherit; font-size: .95rem; padding: 8px 10px; border: 1px solid var(--crease); border-radius: 10px; resize: none; min-height: 42px; max-height: 120px; }
.agent-input textarea:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }

/* phones: a sheet from the bottom of the screen, the Ask button just its icon */
@media (max-width: 640px) {
  .ask-btn .ask-label { display: none; }
  .ask-btn { padding: 6px 10px; }
  .agent-panel { top: auto; bottom: 0; right: 0; left: 0; width: 100%; max-height: 78svh; border-radius: 16px 16px 0 0; }
}
