.agent-launcher {
  position: fixed;
  right: 24px;
  bottom: 78px;
  z-index: 72;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 17px 0 10px;
  border: 1px solid color-mix(in srgb, var(--gold) 44%, var(--line));
  border-radius: 999px;
  color: #fffdf8;
  background: var(--brand-strong);
  box-shadow: 0 16px 40px rgba(8, 42, 36, .24);
  cursor: pointer;
}
.agent-launcher:hover { transform: translateY(-2px); }
.agent-launcher-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--brand-strong); background: var(--gold-soft); font: 800 12px Georgia, serif; }
.agent-launcher-copy { font-size: 13px; font-weight: 800; }

.agent-dialog {
  width: min(760px, calc(100% - 28px));
  height: min(720px, calc(100dvh - 44px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--ink);
  background: var(--surface-solid);
  box-shadow: 0 34px 100px rgba(0, 0, 0, .34);
}
.agent-dialog::backdrop { background: rgba(5, 16, 13, .66); backdrop-filter: blur(7px); }
.agent-panel { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.agent-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: var(--paper-deep); }
.agent-head-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: var(--brand-strong); background: var(--gold-soft); font: 800 16px Georgia, serif; }
.agent-head-copy strong { display: block; font-size: 15px; }
.agent-head-copy small { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; }
.agent-close { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--surface-solid); cursor: pointer; font-size: 21px; line-height: 1; }

.agent-conversation { overflow-y: auto; padding: 22px 20px 30px; scroll-behavior: smooth; }
.agent-intro { margin-bottom: 18px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--gold) 38%, var(--line)); border-radius: 13px; color: var(--muted); background: color-mix(in srgb, var(--gold-soft) 12%, var(--surface-solid)); font-size: 12px; line-height: 1.7; }
.agent-message { display: flex; margin: 14px 0; }
.agent-message.user { justify-content: flex-end; }
.agent-message-card { max-width: min(82%, 580px); padding: 12px 15px; border-radius: 15px 15px 15px 4px; color: var(--ink); background: var(--paper-deep); font-size: 14px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.agent-message.user .agent-message-card { color: #fffdf8; background: var(--brand-strong); border-radius: 15px 15px 4px 15px; }
.agent-message.loading .agent-message-card { color: var(--muted); }
.agent-message.error .agent-message-card { border: 1px solid color-mix(in srgb, #a53f36 35%, var(--line)); color: #92332c; background: color-mix(in srgb, #a53f36 8%, var(--surface-solid)); }
.agent-sources { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.agent-source { display: inline-flex; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--brand); background: var(--surface-solid); font-size: 10px; font-weight: 800; }
.agent-source:hover { border-color: var(--gold); }
.agent-handoff { display: inline-flex; margin-top: 11px; padding: 8px 12px; border-radius: 9px; color: #fffdf8; background: var(--brand); font-size: 11px; font-weight: 800; }

.agent-composer { display: grid; gap: 11px; padding: 15px 20px 18px; border-top: 1px solid var(--line); background: var(--surface-solid); }
.agent-suggestions { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; }
.agent-suggestion { flex: 0 0 auto; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--paper); cursor: pointer; font-size: 10px; }
.agent-suggestion:hover { color: var(--brand); border-color: var(--gold); }
.agent-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.agent-input { width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: var(--ink); background: var(--paper); }
.agent-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.agent-send { min-width: 88px; padding: 0 16px; border: 0; border-radius: 11px; color: #fffdf8; background: var(--brand-strong); cursor: pointer; font-weight: 800; }
.agent-send:disabled, .agent-input:disabled { opacity: .58; cursor: wait; }
.agent-note { margin: 0; color: var(--muted); font-size: 9px; text-align: center; }

@media (max-width: 620px) {
  .agent-launcher { right: 14px; bottom: 70px; padding-right: 12px; }
  .agent-launcher-copy { display: none; }
  .agent-dialog { width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .agent-head { padding: 14px; }
  .agent-conversation { padding: 17px 14px 24px; }
  .agent-composer { padding: 12px 14px 15px; }
  .agent-message-card { max-width: 90%; }
  .agent-send { min-width: 74px; }
}

@media (prefers-reduced-motion: reduce) {
  .agent-conversation { scroll-behavior: auto; }
}

