.counsel-root,
.counsel-widget,
.counsel-dialog { --counsel-ink: var(--color-ink, #101a26); --counsel-navy: var(--color-navy, #222f40); --counsel-paper: var(--color-paper, #f2efde); --counsel-brass: var(--color-brass, #a67e4d); font-family: var(--font-body, Arial, sans-serif); }
.counsel-root { --counsel-look-x: 0; --counsel-look-y: 0; }
.counsel-widget { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 180; display: grid; justify-items: end; gap: 8px; }
.counsel-launch { position: relative; display: inline-flex; align-items: flex-end; gap: 8px; min-height: 150px; padding: 0; border: 0; background: transparent; color: var(--counsel-ink); cursor: pointer; }
.counsel-launch:focus-visible, .counsel-whatsapp:focus-visible, .counsel-icon-button:focus-visible, .counsel-send:focus-visible, .counsel-footer button:focus-visible, .counsel-followup:focus-visible, .counsel-citations a:focus-visible, .counsel-message__copy:focus-visible { outline: 3px solid var(--counsel-brass); outline-offset: 3px; }
.counsel-whatsapp { position: relative; isolation: isolate; display: grid; place-items: center; justify-self: end; width: 58px; height: 58px; margin-right: 29px; border: 2px solid var(--counsel-paper); border-radius: 50%; background: #25d366; color: #fff; box-shadow: 0 6px 18px rgb(16 26 38 / 24%); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.counsel-whatsapp::before { position: absolute; z-index: 0; inset: -5px; border: 1px solid rgb(37 211 102 / 70%); border-radius: inherit; content: ""; pointer-events: none; animation: counsel-whatsapp-heartbeat 3.2s ease-in-out infinite; }
.counsel-whatsapp svg { position: relative; z-index: 1; display: block; width: 29px; height: 29px; overflow: visible; }
.counsel-whatsapp svg path:first-child { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.counsel-whatsapp svg path:last-child { fill: currentColor; }
.counsel-whatsapp:hover { transform: translateY(-2px); box-shadow: 0 9px 23px rgb(16 26 38 / 30%); }
@keyframes counsel-whatsapp-heartbeat { 0%, 30%, 100% { opacity: .42; transform: scale(1); } 8% { opacity: .14; transform: scale(1.16); } 15% { opacity: .5; transform: scale(1); } 23% { opacity: .2; transform: scale(1.1); } }
.counsel-avatar { display: grid; place-items: center; width: 116px; height: 116px; overflow: visible; border: 0; border-radius: 50%; background: transparent; filter: drop-shadow(0 8px 16px rgb(16 26 38 / 20%)); }
.counsel-avatar-art { display: block; width: 100%; height: 100%; overflow: visible; }
.counsel-label { position: absolute; z-index: 1; top: 0; left: 50%; padding: 7px 13px; transform: translateX(-50%); border: 1px solid var(--counsel-brass); border-radius: 999px; background: var(--counsel-navy); color: var(--counsel-paper); box-shadow: 0 4px 12px rgb(16 26 38 / 24%); font-size: 12px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.counsel-invitation { max-width: 260px; padding: 10px 12px; border: 1px solid rgb(166 126 77 / 45%); border-radius: 16px 16px 5px 16px; background: var(--counsel-paper); color: var(--counsel-ink); font-size: 13px; line-height: 1.4; box-shadow: 0 8px 22px rgb(16 26 38 / 14%); }
.counsel-dialog { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 190; display: flex; flex-direction: column; width: min(380px, calc(100vw - 32px)); height: min(540px, calc(100dvh - 96px)); max-height: min(540px, calc(100dvh - 96px)); overflow: hidden; border: 1px solid var(--counsel-brass); border-radius: 30px 13px 25px 15px; background: var(--counsel-paper); color: var(--counsel-ink); box-shadow: 0 18px 48px rgb(16 26 38 / 27%); opacity: 0; transform: translateY(12px) scale(.975); transform-origin: bottom right; transition: opacity .22s ease, transform .22s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.counsel-dialog.is-visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.counsel-dialog[hidden], .counsel-invitation[hidden], .counsel-widget[hidden] { display: none; }
.counsel-dialog__handle { display: none; }
.counsel-header { display: flex; align-items: center; gap: 10px; padding: 10px 13px; background: var(--counsel-navy); color: var(--counsel-paper); }
.counsel-header__avatar { display: grid; place-items: center; width: 76px; height: 76px; overflow: visible; flex: 0 0 auto; }
.counsel-header__avatar .counsel-avatar-art { width: 72px; height: 72px; }
.counsel-header__copy { min-width: 0; flex: 1; }
.counsel-header__title { margin: 0; font: 600 20px/1.1 var(--font-display, Georgia, serif); }
.counsel-header__subtitle { margin: 3px 0 0; color: var(--counsel-paper); font-size: 12px; opacity: .82; }
.counsel-icon-button { display: grid; place-items: center; width: 36px; height: 36px; margin: -4px 4px 0 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--counsel-paper); cursor: pointer; font-size: 20px; line-height: 1; }
.counsel-messages { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 17px 14px 12px; overscroll-behavior: contain; scrollbar-width: thin; scroll-behavior: smooth; }
.counsel-message { width: fit-content; max-width: 92%; margin: 0 0 10px; padding: 12px 14px; border: 1px solid rgb(16 26 38 / 12%); border-radius: 15px 15px 15px 5px; background: #fffdf3; font-size: 14px; line-height: 1.58; letter-spacing: .005em; animation: counsel-message-in .18s ease both; }
.counsel-message--counsel p { margin: 0 0 9px; }
.counsel-message--counsel p:last-child { margin-bottom: 0; }
.counsel-message--counsel h3, .counsel-message--counsel h4 { margin: 11px 0 5px; color: var(--counsel-navy); font-family: var(--font-display, Georgia, serif); font-weight: 600; line-height: 1.3; }
.counsel-message--counsel h3 { font-size: 15px; }
.counsel-message--counsel h4 { font-size: 14px; }
.counsel-message--counsel ul, .counsel-message--counsel ol { display: grid; gap: 5px; margin: 3px 0 10px; padding-left: 20px; }
.counsel-message--counsel li { padding-left: 2px; }
.counsel-message--counsel li::marker { color: var(--counsel-brass); font-weight: 700; }
.counsel-message--counsel strong { color: #253448; font-weight: 700; }
.counsel-citation-marker { display: inline-block; margin: 0 1px; padding: 0 4px; border: 1px solid rgb(166 126 77 / 35%); border-radius: 4px; background: rgb(166 126 77 / 10%); color: #65491f; font-size: .72em; font-weight: 700; line-height: 1.5; vertical-align: .18em; }
.counsel-message__copy { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 23px; margin: 8px 0 -3px auto; padding: 5px 0 0 8px; border: 0; border-top: 1px solid rgb(16 26 38 / 11%); background: transparent; color: rgb(16 26 38 / 66%); font: inherit; font-size: 10px; line-height: 1; cursor: pointer; }
.counsel-message__copy svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.35; }
.counsel-message__copy:hover { color: var(--counsel-ink); text-decoration: underline; text-underline-offset: 2px; }
.counsel-message__copy:disabled { cursor: default; }
.counsel-message--visitor { margin-left: auto; border-color: var(--counsel-brass); border-radius: 15px 15px 5px 15px; background: var(--counsel-brass); color: var(--counsel-ink); }
.counsel-thinking { display: flex; align-items: center; gap: 9px; width: fit-content; max-width: 88%; margin: 0 0 12px; padding: 11px 13px; border: 1px solid rgb(16 26 38 / 12%); border-radius: 15px 15px 15px 5px; background: #fffdf3; color: rgb(16 26 38 / 74%); font-size: 12px; line-height: 1.35; }
.counsel-thinking__dots { display: inline-flex; align-items: center; gap: 3px; height: 12px; }
.counsel-thinking__dots i { display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--counsel-brass); animation: counsel-thinking-pulse 1.15s ease-in-out infinite; }
.counsel-thinking__dots i:nth-child(2) { animation-delay: .16s; }
.counsel-thinking__dots i:nth-child(3) { animation-delay: .32s; }
.counsel-followups { display: grid; gap: 8px; margin: 4px 0 13px; padding: 12px; border: 1px solid rgb(16 26 38 / 12%); border-radius: 14px 14px 14px 5px; background: rgb(255 253 243 / 78%); }
.counsel-followups__heading { margin: 0; color: rgb(16 26 38 / 72%); font-size: 11px; font-weight: 700; letter-spacing: .055em; line-height: 1.35; text-transform: uppercase; }
.counsel-followups__list { display: grid; gap: 6px; }
.counsel-followup { display: flex; align-items: center; min-height: 38px; padding: 8px 10px; border: 1px solid rgb(16 26 38 / 16%); border-radius: 9px 9px 9px 3px; background: #fffdf3; color: var(--counsel-ink); font-size: 12px; font-weight: 600; line-height: 1.35; text-decoration: none; }
.counsel-followup::after { content: "›"; flex: 0 0 auto; margin-left: auto; padding-left: 8px; color: var(--counsel-brass); font-size: 19px; line-height: 1; }
.counsel-followup:hover { border-color: var(--counsel-brass); background: #fffaf0; }
.counsel-followup--consultation { border-color: var(--counsel-brass); background: var(--counsel-brass); }
.counsel-followup--consultation::after { color: var(--counsel-ink); }
.counsel-citations { border-top: 1px solid rgb(16 26 38 / 12%); padding-top: 7px; }
.counsel-citations summary { color: rgb(16 26 38 / 72%); cursor: pointer; font-size: 11px; }
.counsel-citations a { display: block; margin-top: 6px; color: var(--counsel-ink); font-size: 11px; line-height: 1.4; text-decoration: underline; text-underline-offset: 2px; }
.counsel-source-row { display: grid; gap: 2px; margin-top: 6px; }
.counsel-source-row .counsel-source { margin-top: 0; }
.counsel-source__status { color: rgb(16 26 38 / 65%); font-size: 10px; line-height: 1.35; }
.counsel-composer { display: grid; flex: 0 0 auto; grid-template-columns: minmax(0, 1fr) 70px; width: 100%; gap: 8px; padding: 8px 14px; border-top: 1px solid rgb(16 26 38 / 14%); }
.counsel-composer textarea { display: block; width: 100%; height: 42px; min-height: 42px; max-height: 76px; overflow-y: hidden; resize: none; padding: 9px 11px; border: 1px solid rgb(16 26 38 / 38%); border-radius: 13px 8px 12px 9px; background: #fffdf3; color: var(--counsel-ink); font: inherit; font-size: 16px; line-height: 1.25; box-sizing: border-box; }
.counsel-composer textarea:focus { outline: 2px solid var(--counsel-brass); outline-offset: 2px; }
.counsel-send { width: 70px; min-width: 70px; height: 42px; align-self: start; border: 1px solid var(--counsel-brass); border-radius: 12px 8px 11px 9px; background: var(--counsel-brass); color: var(--counsel-ink); font-weight: 700; cursor: pointer; }
.counsel-status { grid-column: 1 / -1; min-height: 16px; color: var(--counsel-ink); font-size: 11px; }
.counsel-footer { display: flex; flex: 0 0 auto; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 0 14px max(10px, env(safe-area-inset-bottom)); font-size: 10px; }
.counsel-footer__notice { display: grid; max-width: 83%; gap: 5px; }
.counsel-footer__notice nav { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.counsel-footer__notice a { color: var(--counsel-ink); text-decoration: underline; text-underline-offset: 2px; }
.counsel-footer__notice a:focus-visible { outline: 2px solid var(--counsel-brass); outline-offset: 2px; }
.counsel-footer button { border: 0; padding: 0; background: transparent; color: var(--counsel-ink); text-decoration: underline; cursor: pointer; }
@keyframes counsel-message-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes counsel-thinking-pulse { 0%, 60%, 100% { opacity: .4; transform: translateY(0) scale(.8); } 30% { opacity: 1; transform: translateY(-3px) scale(1); } }
@media (max-width: 639px) {
  .counsel-widget { right: max(12px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); }
  .counsel-launch { min-height: 142px; }
  .counsel-avatar { width: 108px; height: 108px; }
  .counsel-whatsapp { width: 54px; height: 54px; margin-right: 27px; }
  .counsel-whatsapp svg { width: 27px; height: 27px; }
  .counsel-dialog { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: min(360px, calc(100vw - 24px)); height: min(78dvh, 640px); max-height: calc(var(--counsel-viewport-height, 100dvh) - 24px); border-radius: 30px 14px 24px 12px; transform-origin: bottom center; }
  .counsel-dialog__handle { display: block; position: absolute; z-index: 1; left: 50%; width: 38px; height: 4px; margin: 7px auto 0; border-radius: 99px; background: rgb(242 239 222 / 55%); transform: translateX(-50%); }
  .counsel-header { padding-top: 15px; }
  .counsel-root.counsel-keyboard-open .counsel-dialog { bottom: 8px; height: min(480px, calc(var(--counsel-viewport-height, 100dvh) - 16px)); max-height: calc(var(--counsel-viewport-height, 100dvh) - 16px); }
  .counsel-composer { grid-template-columns: minmax(0, 1fr) 68px; padding-left: 12px; padding-right: 12px; }
  .counsel-composer .counsel-send { width: 68px; min-width: 68px; height: 42px; }
}
@media (min-width: 640px) {
  .counsel-widget { right: max(26px, calc(env(safe-area-inset-right) + 10px)); }
}
@media (prefers-reduced-motion: reduce) {
  .counsel-whatsapp { transition: none; }
  .counsel-whatsapp::before { animation: none; opacity: .42; transform: none; }
  .counsel-dialog { transition: opacity .08s linear; transform: none; }
  .counsel-dialog.is-visible { transform: none; }
  .counsel-message { animation: none; }
  .counsel-thinking__dots i { animation: none; opacity: 1; }
}
