:root {
  --cosma-blue: #0a3764;
  --cosma-link: #075d93;
  --cosma-green: #54ad2b;
  --cosma-edge: #d7e6ef;
}

.cosma-launcher,
.cosma-dialog {
  font-family: inherit;
  color: var(--cosma-blue);
}

.cosma-launcher {
  position: fixed;
  z-index: 930;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(28px + env(safe-area-inset-bottom));
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 91px;
  max-width: calc(100vw - 32px);
  padding: 4px 21px 4px 7px;
  border: 2px solid var(--cosma-green);
  border-radius: 999px;
  background: linear-gradient(110deg, #0b365e, #075d93);
  color: #fff;
  box-shadow: 0 9px 23px #08375a48;
  font-size: 1.64rem;
  font-weight: 800;
  text-align: left;
  line-height: 1.15;
  cursor: pointer;
}

.cosma-launcher img {
  width: 77px;
  height: 77px;
  box-shadow: 0 0 0 1px #ffffffb0;
}

.cosma-launcher-label {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.cosma-launcher-role {
  color: #d9f1fb;
  font-size: .72em;
  font-weight: 700;
}

.cosma-launcher-name {
  color: #fff;
  font-size: 1.06em;
}

.cosma-launcher img, .cosma-header img {
  display: block;
  border-radius: 50%;
  object-fit: contain;
  flex: 0 0 auto;
}

.cosma-portrait-button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 2px;
  border: 1px solid #ffffff78;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
}

.cosma-portrait-button:hover {
  border-color: #b9ed9b;
}

.cosma-portrait-dialog {
  position: fixed;
  box-sizing: border-box;
  width: min(560px, calc(100% - 28px), calc(100dvh - 28px));
  max-width: none;
  max-height: none;
  padding: 12px;
  overflow: hidden;
  border: 2px solid var(--cosma-green);
  border-radius: 18px;
  background: #082e55;
  box-shadow: 0 24px 72px #082f5a70;
}

.cosma-portrait-dialog::backdrop {
  background: #071f37b0;
}

.cosma-portrait-dialog img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

.cosma-portrait-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #ffffff78;
  border-radius: 50%;
  background: #082e55;
  color: #fff;
  font: inherit;
  font-size: 1.6rem;
  cursor: pointer;
}

.cosma-portrait-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.cosma-launcher:hover {
  background: linear-gradient(110deg, #104774, #0870a7);
  box-shadow: 0 10px 26px #08375a5a;
}

.cosma-chip:hover {
  background: #eaf6fc;
}

.cosma-dialog {
  box-sizing: border-box;
  width: min(440px, calc(100% - 24px));
  max-width: none;
  height: min(690px, calc(100dvh - 28px));
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--cosma-edge);
  border-top: 4px solid var(--cosma-green);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 72px #082f5a55;
  font-size: .94rem;
}

.cosma-dialog[open] {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
}

html.cosma-contact-ready :is(.home-contact-button, .competitor-offer-button) {
  display: none !important;
}

.cosma-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--cosma-edge);
}

.cosma-quick-actions a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  box-sizing: border-box;
}

.cosma-quick-actions [hidden] {
  display: none !important;
}

.cosma-dialog::backdrop {
  background: #071f37a0;
}

.cosma-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: #fff;
  background: linear-gradient(115deg, #0b375f, #08659a);
}

.cosma-header h2,
.cosma-header p {
  margin: 0;
  color: inherit;
}

.cosma-header h2 {
  font-size: 1.45rem;
  line-height: 1.08;
}

.cosma-header p {
  margin-top: 4px;
  font-size: .82rem;
}

.cosma-close {
  margin-left: auto;
  flex: 0 0 44px;
  height: 44px;
  border: 1px solid #ffffff50;
  border-radius: 50%;
  background: #ffffff15;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
}

.cosma-log {
  min-width: 0;
  padding: 14px 12px 12px;
  overflow: auto;
  overscroll-behavior: contain;
  background: #f5f9fc;
}

.cosma-message {
  width: fit-content;
  max-width: 96%;
  margin: 0 0 9px;
  padding: 9px 11px;
  overflow-wrap: anywhere;
  border: 1px solid var(--cosma-edge);
  border-radius: 4px 14px 14px;
  background: #fff;
}

.cosma-message--visitor {
  margin-left: auto;
  border-radius: 14px 4px 14px 14px;
  background: #e5f3fa;
}

.cosma-author {
  display: block;
  margin-bottom: 4px;
  color: var(--cosma-link);
  font-size: .78rem;
}

.cosma-dialog .cosma-phone {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  max-width: 100%;
  min-height: 44px;
  margin: 2px 0 8px;
  padding: 6px 12px;
  border: 2px solid var(--cosma-green);
  border-radius: 10px;
  background: #eaf6fc;
  color: var(--cosma-blue);
  font-size: clamp(1rem, 4vw, 1.25rem);
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
}

.cosma-dialog .cosma-phone:hover {
  background: #d9eef8;
  text-decoration: underline;
}

.cosma-message p {
  margin: 0 0 6px;
  line-height: 1.42;
}

.cosma-message p:last-child {
  margin-bottom: 0;
}

.cosma-actions,
.cosma-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
}

.cosma-actions {
  margin-top: 6px;
}

.cosma-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  color: var(--cosma-link);
  font-size: .85rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cosma-suggestions {
  padding: 8px 12px 2px;
}

.cosma-suggestions[hidden] {
  display: none;
}

.cosma-chip {
  min-height: 38px;
  border: 1px solid #b9d8e9;
  border-radius: 18px;
  padding: 5px 9px;
  background: #fff;
  color: var(--cosma-link);
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
}

.cosma-chip:disabled {
  opacity: .62;
  cursor: default;
}

.cosma-form {
  display: grid;
  gap: 5px;
  padding: 8px 12px 11px;
}

.cosma-label {
  font-weight: 750;
  font-size: .82rem;
}

.cosma-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.cosma-composer input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #a7c4d7;
  border-radius: 9px;
  padding: 7px 9px;
  color: var(--cosma-blue);
  font: inherit;
  font-size: 16px;
}

.cosma-send {
  min-height: 44px;
  min-width: 65px;
  border: 1px solid var(--cosma-link);
  border-radius: 9px;
  padding: 5px 9px;
  background: var(--cosma-link);
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.cosma-send:disabled {
  opacity: .65;
  cursor: wait;
}

.cosma-notice {
  margin: 2px 0 0;
  color: #405c74;
  font-size: .73rem;
  line-height: 1.35;
}

.cosma-notice a {
  color: var(--cosma-link);
  text-decoration: underline;
}

.cosma-launcher:focus-visible,
.cosma-dialog :focus-visible {
  outline: 2px solid #0477aa;
  outline-offset: 2px;
}

.cosma-close:focus-visible {
  outline-color: #fff;
}

@media (min-width: 1025px) and (hover: hover) and (pointer: fine) {
  .cosma-launcher {
    bottom: calc(28px + 1.5vh + env(safe-area-inset-bottom));
    bottom: calc(28px + 1.5dvh + env(safe-area-inset-bottom));
  }
}

@media (max-width: 760px) {
  .cosma-launcher {
    transform: scale(.8);
    transform-origin: bottom right;
    max-width: min(calc(100vw - 130px), 315px);
    padding-right: 13px;
    gap: 7px;
    font-size: 1.42rem;
  }
  .cosma-launcher img {
    width: 62px;
    height: 62px;
  }
  .cosma-dialog {
    width: min(440px, calc(100% - 14px));
    height: min(690px, calc(100dvh - 16px));
    border-radius: 15px;
  }
}

@media (max-width: 350px) {
  .cosma-launcher {
    gap: 6px;
    padding-right: 9px;
  }
}

@media (max-height: 460px) {
  .cosma-header {
    padding-block: 5px;
  }
  .cosma-header img {
    width: 36px;
    height: 36px;
  }
}
