#finiqChat {
  width: min(960px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid #d7e3f4;
  border-radius: 16px;
  color: #152743;
  background: #fff;
  overflow: auto;
}
#finiqChat::backdrop { background: #0c1e3d75; }
#finiqChat [hidden] { display: none; }
.finiq-chat-header, .finiq-chat-form, .finiq-chat-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.finiq-chat-header {
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid #d7e3f4;
}
.finiq-chat-header h2, .finiq-chat-grid h3 { margin: 0; }
.finiq-chat-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr);
  min-height: 420px;
}
.finiq-chat-grid > section { padding: 16px; }
.finiq-chat-grid > section:first-child { border-right: 1px solid #d7e3f4; }
.finiq-chat-form > :first-child { flex: 1; min-width: 0; }
#finiqChat :is(button, input, select, textarea) {
  margin: 0;
  font: inherit;
  color: inherit;
}
#finiqChat button {
  padding: 6px 9px;
  border: 1px solid #b9cdea;
  border-radius: 7px;
  background: #eef5ff;
  cursor: pointer;
  overflow-wrap: anywhere;
}
#finiqChat button[aria-pressed="true"] { background: #c9e0ff; }
#finiqChat ul { padding: 0; list-style: none; }
#finiqChat [data-contacts], #finiqChat [data-threads] { max-height: 155px; overflow: auto; }
#finiqChat [data-contacts] li, #finiqChat [data-threads] li { margin: 4px 0; }
#finiqChat [data-contacts] button { margin: 0 6px; }
#finiqChat [data-history] {
  height: clamp(170px, 35vh, 360px);
  overflow: auto;
  overflow-wrap: anywhere;
}
#finiqChat [data-history] li { padding: 8px 0; border-bottom: 1px solid #e4edf8; }
#finiqChat [data-history] p { margin: 4px 0; white-space: pre-wrap; }
#finiqChat time { margin-left: 8px; font-size: .8em; }
#finiqChat [role="status"]:not(:empty) { margin: 10px 16px; color: #8b2222; }
@media (max-width: 650px) {
  .finiq-chat-grid { grid-template-columns: minmax(0, 1fr); }
  .finiq-chat-grid > section:first-child { border-right: 0; border-bottom: 1px solid #d7e3f4; }
}

.finiq-media-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
}
.finiq-media-actions label, #finiqChatLive form label {
  display: grid;
  gap: 4px;
}
#finiqChat [data-media] {
  border-top: 1px solid #d7e3f4;
  margin-bottom: 12px;
  padding: 8px 0;
}
#finiqChat [data-media] summary { cursor: pointer; }
#finiqChat [data-media] .finiq-media-actions { margin-top: 8px; }
#finiqChat [data-media-items] { max-height: 103px; overflow: auto; }
#finiqChat canvas, #finiqChatLive canvas { max-width: 100%; height: auto; }
#finiqChatLive {
  position: fixed;
  inset: auto 12px 12px auto;
  z-index: 1000;
  margin: 0;
  width: min(420px, calc(100vw - 24px));
  padding: 14px;
  border: 1px solid #b9cdea;
  border-radius: 12px;
  background: #fff;
  color: #152743;
  box-shadow: 0 5px 20px #0c1e3d38;
}
#finiqChatLive h2 { margin: 0; font-size: 1.15rem; }
#finiqChatLive [hidden] { display: none; }
#finiqChatLive form { margin: 8px 0; }
#finiqChatLive button {
  padding: 6px 9px;
  border: 1px solid #b9cdea;
  border-radius: 7px;
  color: inherit;
  background: #eef5ff;
  cursor: pointer;
}
#finiqChatMediaStatus:not(:empty) {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 990;
  padding: 9px;
  background: #eef5ff;
  color: #152743;
  border-radius: 7px;
}

#finiqChatLive { max-height: calc(100dvh - 24px); overflow: auto; }
#finiqChatLive [data-share-choice] button { margin-top: 6px; }

.finiq-chat-canvas-wrap { max-width: 100%; overflow: auto; max-height: 53vh; }
#finiqChat canvas.finiq-financial-canvas, #finiqChatLive canvas.finiq-financial-canvas { max-width: none; }

#finiqChat .finiq-guide-inline {
  position: static;
  width: auto;
  max-height: none;
  overflow: visible;
  padding: 12px 0 0;
  border: 0;
  box-shadow: none;
}
#finiqChat .finiq-guide-inline input { margin: 6px 0 10px; }
#finiqChat .finiq-guide-questions ul { padding-inline-start: 20px; list-style: disc; }

.finiq-chat-avatar {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  margin-inline-end: 7px;
  padding-inline: 3px;
  border-radius: 50%;
  background: #dceafe;
  color: #174478;
  vertical-align: middle;
  font-size: 12px;
  font-weight: 700;
}
.finiq-chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20020;
  padding: 12px 20px;
  border: 0;
  border-radius: 12px;
  background: #1254aa;
  color: #fff;
  box-shadow: 0 4px 18px #163c6b33;
  font: 700 15px system-ui;
  cursor: pointer;
}
#finiqChat {
  position: fixed;
  inset: auto 20px 76px auto;
  z-index: 20021;
  margin: 0;
  width: min(420px, calc(100vw - 40px));
  max-height: calc(100dvh - 96px);
  box-shadow: 0 12px 36px #132f6250;
  color-scheme: light;
  font: 14px/1.45 system-ui;
}
#finiqChat .finiq-chat-grid { display: block; min-height: 0; }
#finiqChat .finiq-chat-grid > section { border: 0; }
#finiqChat[data-section="directory"] [data-chat-messages],
#finiqChat:not([data-section="directory"]) [data-chat-directory],
#finiqChat[data-section="directory"] [data-directory] { display: none; }
#finiqChat [data-directory] { margin: 12px 16px 0; }
#finiqChat .finiq-chat-header { justify-content: flex-start; }
#finiqChat [data-close] { margin-inline-start: auto; }
#finiqChat .finiq-chat-search { display: grid; gap: 4px; margin: 14px 0; }
#finiqChat :is(input:not([type="checkbox"]), textarea, select) {
  padding: 7px;
  border: 1px solid #bdd0e8;
  border-radius: 7px;
  background: #fff;
}
#finiqChat [data-history] {
  padding: 8px;
  border-radius: 10px;
  background: #edf3fb;
}
#finiqChat [data-history] li {
  width: fit-content;
  max-width: 87%;
  padding: 7px 10px;
  margin-bottom: 8px;
  border: 1px solid #d5e1ef;
  border-radius: 10px;
  background: #fff;
}
#finiqChat [data-history] .finiq-chat-own {
  margin-inline-start: auto;
  background: #dceaff;
}
#finiqChat button:disabled { cursor: wait; opacity: .6; }
@media (max-width: 480px) {
  #finiqChat { right: 12px; width: calc(100vw - 24px); }
  .finiq-chat-launcher { right: 12px; }
}

#finiqChat [data-assistant-history] {
  max-height: 235px;
  overflow: auto;
  background: #edf3fb;
  border-radius: 10px;
  padding: 8px;
}
#finiqChat [data-assistant-history] li { padding: 4px 8px; }
#finiqChat [data-assistant-history] p { margin: 4px 0; overflow-wrap: anywhere; }
#finiqChat [data-contact-support] { margin: 12px 0; }

#finiqChat [data-contacts] { max-height: 245px; }
#finiqChat [data-contacts] details {
  border: 1px solid #d7e3f4;
  border-radius: 8px;
}
#finiqChat [data-contacts] summary {
  padding: 7px 9px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
#finiqChat [data-contacts] summary small { margin-inline-start: 8px; color: #50657e; }
#finiqChat .finiq-chat-contact-card { padding: 8px 12px 12px; overflow-wrap: anywhere; }
#finiqChat .finiq-chat-contact-card p { margin: 4px 0 8px; }
#finiqChat .finiq-chat-contact-card button { margin: 0; }

#finiqChat [data-chat-capture] {
  margin: 10px 0;
  padding: 9px;
  border: 1px solid #d7e3f4;
  border-radius: 8px;
}
#finiqChat [data-chat-capture] canvas {
  display: block;
  width: 100%;
  height: auto;
  margin: 8px 0;
}
#finiqChat [data-chat-capture] [hidden] { display: none; }
#finiqChat [data-chat-capture] ul:empty { display: none; }
#finiqChat [data-chat-capture] li { margin: 3px 0; }

.finiq-chat-unread {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  min-width: 21px;
  height: 21px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #be2435;
  color: #fff;
  font: 700 11px/1 system-ui;
}
.finiq-chat-unread[hidden] { display: none; }
