.roof-representative-card {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 860;
  font-family: inherit;
}

body:has(.contractor-selection-footer:not([hidden])) .roof-representative-card {
  bottom: max(96px, calc(env(safe-area-inset-bottom) + 82px));
}

.roof-representative-card-panel {
  position: relative;
  width: min(238px, calc(100vw - 28px));
  padding: 31px 8px 8px;
  border: 2px solid #05703b;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(5, 28, 15, .28);
  animation: roof-representative-card-enter 240ms ease-out both;
}

.roof-representative-card-label {
  position: absolute;
  top: 8px;
  left: 10px;
  right: 40px;
  overflow: hidden;
  margin: 0;
  color: #123d25;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roof-representative-card-image {
  display: block;
  width: 100%;
  max-height: min(54vh, 480px);
  border-radius: 5px;
  object-fit: contain;
  background: #fff;
}

.roof-representative-card-contact:empty {
  display: none;
}

.roof-representative-card-contact p {
  margin: 8px 2px 6px;
  color: #123d25;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
  text-align: center;
}

.roof-representative-card-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.roof-representative-card-link {
  display: grid;
  min-width: 0;
  min-height: 34px;
  place-items: center;
  padding: 6px 4px;
  border: 1px solid rgba(0, 0, 0, .16);
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
}

.roof-representative-card-link.is-sms { border: 2px solid #b42318; background: #f7c948; color: #172019; }
.roof-representative-card-link.is-whatsapp { background: #137a3a; }
.roof-representative-card-link.is-telegram { background: #1877a8; }
.roof-representative-card-link.is-messenger { background: #075ecc; }
.roof-representative-card-link:hover,
.roof-representative-card-link:focus-visible { filter: brightness(.9); }

.roof-representative-card-close {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #123d25;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.roof-representative-card-toggle {
  display: none;
  width: 64px;
  height: 78px;
  padding: 3px;
  overflow: hidden;
  border: 3px solid #f26d00;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(5, 28, 15, .28);
  cursor: pointer;
}

.roof-representative-card-toggle img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  object-fit: cover;
  object-position: 50% 8%;
}

.roof-representative-card[data-collapsed="true"] .roof-representative-card-panel {
  display: none;
}

.roof-representative-card[data-collapsed="true"] .roof-representative-card-toggle {
  display: block;
}

.roof-representative-card button:focus-visible {
  outline: 3px solid #ffca28;
  outline-offset: 3px;
}

.roof-home-advocate-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 3px solid #b42318;
  border-radius: 8px;
  background: #fff;
  color: #10281f;
  box-shadow: 0 24px 72px rgba(5, 28, 15, .38);
}

.roof-home-advocate-dialog::backdrop { background: rgba(7, 24, 15, .72); }
.roof-home-advocate-dialog-panel { display: grid; gap: 14px; padding: 18px; }
.roof-home-advocate-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.roof-home-advocate-dialog-header h2 { margin: 2px 0 0; font-size: 32px; line-height: 1.05; }
.roof-home-advocate-eyebrow { margin: 0; color: #b42318; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.roof-home-advocate-dialog-copy { margin: 0; color: #42584a; line-height: 1.5; }
.roof-home-advocate-dialog-image { display: block; width: min(100%, 480px); max-height: 48vh; margin: 0 auto; object-fit: contain; }
.roof-home-advocate-dialog-contact { width: min(100%, 480px); margin: 0 auto; }
.roof-home-advocate-dialog-contact .roof-representative-card-link { min-height: 44px; font-size: 13px; }
.roof-home-advocate-dialog-close { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #123d25; color: #fff; font-size: 28px; cursor: pointer; }
.roof-home-advocate-dialog-done { min-height: 50px; border: 3px solid #b42318; border-radius: 4px; background: #f7c948; color: #172019; font: inherit; font-size: 16px; font-weight: 900; cursor: pointer; }
.roof-home-advocate-dialog button:focus-visible,.roof-home-advocate-dialog a:focus-visible { outline: 3px solid #f7c948; outline-offset: 3px; }

@keyframes roof-representative-card-enter {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 600px) {
  .roof-representative-card {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  body:has(.contractor-selection-footer:not([hidden])) .roof-representative-card {
    bottom: max(88px, calc(env(safe-area-inset-bottom) + 76px));
  }

  .roof-representative-card-panel {
    width: min(170px, calc(100vw - 16px));
    padding: 29px 6px 6px;
  }

  .roof-representative-card-image {
    max-height: min(36vh, 310px);
  }

  .roof-representative-card-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roof-representative-card-link { min-height: 38px; }

  .roof-representative-card-toggle {
    width: 54px;
    height: 66px;
  }

  .roof-home-advocate-dialog-panel { padding: 14px; }
  .roof-home-advocate-dialog-header h2 { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  .roof-representative-card-panel { animation: none; }
}
