.arj-chat-launcher {
  position: fixed; right: max(24px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); z-index: 55;
  display: inline-flex; align-items: center; gap: 10px; min-height: 54px; padding: 13px 21px;
  border: 1px solid var(--bronze-deep); border-radius: 32px; background: var(--bronze-deep); color: #fff;
  box-shadow: 0 8px 28px #39261926; font: 600 16px/1.4 var(--body); cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.arj-chat-launcher:hover { transform: translateY(-2px); box-shadow: 0 10px 32px #39261936; }
.arj-chat-launcher svg, .arj-chat-icon svg { width: 22px; height: 22px; flex: none; }
body.menu-open .arj-chat-launcher { visibility: hidden; }
.arj-chat-launcher.is-yielding-to-form { visibility: hidden; pointer-events: none; }
.arj-chat {
  position: fixed; inset: auto 24px 24px auto; margin: 0; padding: 0; width: 416px; max-width: calc(100vw - 32px);
  height: 626px; max-height: calc(100dvh - 48px); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 80px #2a1e183b;
  font: 16px/1.5 var(--body); overflow: hidden;
}
.arj-chat::backdrop { background: #30241d22; }
.arj-chat[open] { display: flex; flex-direction: column; animation: arj-chat-enter 180ms ease-out; }
.arj-chat *, .arj-chat-launcher { box-sizing: border-box; }
.arj-chat-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 17px 18px 15px 22px; border-bottom: 1px solid var(--line); flex-shrink: 0; background: var(--paper); }
.arj-chat-brand { display: flex; align-items: center; gap: 11px; }
.arj-chat-mark { height: 37px; width: 37px; display: grid; place-items: center; border: 1px solid var(--bronze-pale); border-radius: 50%; color: var(--bronze-deep); font: 26px/1 var(--display); }
.arj-chat-title { margin: 0; font: 400 23px/1.15 var(--display); letter-spacing: -.02em; }
.arj-chat-subtitle { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-soft); }
.arj-chat-actions { display: flex; gap: 2px; }
.arj-chat-icon { width: 44px; height: 44px; padding: 10px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--ink-soft); background: transparent; cursor: pointer; }
.arj-chat-icon:hover { background: var(--paper-deep); }
.arj-chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 23px 22px 18px; scroll-behavior: smooth; }
.arj-chat-welcome h3 { margin: 0 0 8px; font: 400 30px/1.14 var(--display); letter-spacing: -.035em; }
.arj-chat-welcome p { margin: 0 0 19px; color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.arj-chat-prompts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 22px; }
.arj-chat-prompt { min-height: 48px; padding: 10px 12px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink-soft); font: 500 14px/1.4 var(--body); cursor: pointer; }
.arj-chat-prompt:hover { background: var(--paper); border-color: var(--bronze); }
.arj-chat-log { display: flex; flex-direction: column; gap: 16px; }
.arj-chat-message { width: 100%; overflow-wrap: anywhere; }
.arj-chat-message p { margin: 0; white-space: pre-wrap; font-size: 15px; line-height: 1.6; }
.arj-chat-message[data-role="user"] { align-self: flex-end; max-width: 91%; padding: 12px 15px; border-radius: 14px 14px 3px 14px; background: var(--paper-deep); }
.arj-chat-message[data-role="assistant"] { padding: 0 0 0 1px; }
.arj-chat-speaker { display: block; margin: 0 0 5px; font-size: 12px; font-weight: 600; letter-spacing: .035em; color: var(--bronze-deep); }
.arj-chat-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.arj-chat-links a { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--bronze-deep); text-decoration: none; }
.arj-chat-links a:hover { background: var(--paper); }
.arj-chat-busy { min-height: 23px; margin: 10px 0 0; color: var(--ink-faint); font-size: 14px; }
.arj-chat-busy:empty { min-height: 0; margin: 0; }
.arj-chat-form { flex-shrink: 0; padding: 12px 18px 14px; border-top: 1px solid var(--line); background: var(--paper); }
.arj-chat-compose { display: flex; align-items: flex-end; gap: 8px; padding: 7px 7px 7px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.arj-chat-compose:focus-within { border-color: var(--bronze); }
.arj-chat-input { flex: 1; min-width: 0; max-height: 100px; min-height: 42px; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); padding: 9px 0 6px; font: 16px/1.5 var(--body); }
.arj-chat-input::placeholder { color: var(--ink-faint); }
.arj-chat-send { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border: 0; border-radius: 9px; background: var(--bronze-deep); color: #fff; cursor: pointer; }
.arj-chat-send svg { width: 20px; height: 20px; }
.arj-chat-send:disabled { opacity: .4; cursor: default; }
.arj-chat-notice { margin: 9px 1px 0; font-size: 12px; line-height: 1.45; color: var(--ink-soft); }
.arj-chat-notice button { display: inline; padding: 0; background: none; border: 0; color: var(--bronze-deep); font: inherit; text-decoration: underline; cursor: pointer; }
.arj-chat-privacy { margin: 7px 1px 0; font-size: 12px; color: var(--ink-soft); line-height: 1.45; }
.arj-chat [hidden] { display: none !important; }
.arj-chat:focus { outline: none; }
@keyframes arj-chat-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
  .arj-chat-launcher { right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); width: 50px; height: 50px; min-height: 50px; padding: 0; gap: 0; justify-content: center; border-radius: 50%; }
  .arj-chat-launcher > span { display: none; }
}
@media (max-width: 520px) {
  .arj-chat { inset: auto 8px max(8px, env(safe-area-inset-bottom)) 8px; width: auto; max-width: none; height: 650px; max-height: calc(100dvh - 16px - env(safe-area-inset-bottom)); border-radius: 15px; }
  .arj-chat-scroll { padding: 20px 18px 16px; }
  .arj-chat-top { padding: 14px 12px 13px 18px; }
  .arj-chat-form { padding: 11px 13px 12px; }
}
@media (prefers-reduced-motion: reduce) { .arj-chat[open], .arj-chat-launcher { animation: none; transition: none; } .arj-chat-scroll { scroll-behavior: auto; } }
