/* Contact and recent-document tiles match the compact Alte semnale cards. */
@media (min-width: 980px) {
  html body #root div:has(> .client-dossier-footer-panel > .client-dossier-contact-edit) {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr) !important;
  }
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  column-gap: 8px !important;
  row-gap: 10px !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  align-content: start !important;
  justify-self: start !important;
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > :first-child,
html body #root .client-dossier-footer-panel:has(> .client-dossier-recent-document) > :first-child {
  grid-column: 1 / -1 !important;
  height: 60px !important;
  min-height: 60px !important;
  box-sizing: border-box !important;
  padding: 0 0 4px !important;
  margin: 0 !important;
  border-bottom: 0 !important;
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .client-dossier-contact-edit,
html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .client-dossier-contact-edit:nth-of-type(3) {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  gap: 5px !important;
  grid-column: auto !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 90px !important;
  max-height: none !important;
  box-sizing: border-box !important;
  padding: 10px 16px !important;
  border: 0 !important;
  border-left: 1px solid #d7e0e9 !important;
  border-bottom: 1px solid #d7e0e9 !important;
  border-radius: 0 !important;
  background: #fff !important;
  background-image: none !important;
  box-shadow: none !important;
  overflow: hidden !important;
  text-align: left !important;
  cursor: pointer !important;
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .client-dossier-contact-edit:nth-of-type(1) {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .client-dossier-contact-edit:nth-of-type(2) {
  grid-column: 1 !important;
  grid-row: 3 !important;
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .client-dossier-contact-edit:nth-of-type(3) {
  grid-column: 1 / -1 !important;
  grid-row: 4 !important;
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .client-dossier-contact-edit::before,
html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .client-dossier-contact-edit::after,
html body #root .client-dossier-footer-panel:has(> .client-dossier-recent-document) > .client-dossier-recent-document::before,
html body #root .client-dossier-footer-panel:has(> .client-dossier-recent-document) > .client-dossier-recent-document::after {
  content: none !important;
  display: none !important;
  background: none !important;
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .client-dossier-contact-edit > span:last-child {
  order: 0 !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  font-size: 16px !important;
  line-height: 1.15 !important;
  font-weight: 900 !important;
  color: #111b30 !important;
  text-align: left !important;
  white-space: normal !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .client-dossier-contact-edit > span:first-child {
  order: 1 !important;
  font-size: 12.5px !important;
  line-height: 1.2 !important;
  font-weight: 400 !important;
  color: #82909e !important;
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .btn:last-child {
  grid-column: 2 !important;
  grid-row: 3 !important;
  width: 100% !important;
  min-height: 90px !important;
  margin: 0 !important;
  padding: 10px 16px !important;
  border: 0 !important;
  border-left: 1px solid #d7e0e9 !important;
  border-bottom: 1px solid #d7e0e9 !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #111b30 !important;
  -webkit-text-fill-color: #111b30 !important;
  text-align: left !important;
  justify-content: flex-start !important;
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .btn:last-child:hover,
html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .btn:last-child:focus-visible,
html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .btn:last-child:active {
  background: #fff !important;
  border-left: 3px solid #16a99c !important;
  padding-left: 14px !important;
  box-shadow: 0 12px 26px rgba(15, 23, 42, .15) !important;
  transform: translateY(-3px) !important;
  color: #111b30 !important;
  -webkit-text-fill-color: #111b30 !important;
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .btn:last-child:focus-visible {
  outline: 2px solid #16a99c !important;
  outline-offset: 2px !important;
}

/* Editing replaces the contact tiles: give the replacement its own visible layout. */
html body #root .client-dossier-footer-panel:has(> div > label > input) {
  display: grid !important;
  width: min(100%, 370px) !important;
  max-width: 370px !important;
  box-sizing: border-box !important;
  align-content: start !important;
  justify-self: start !important;
  overflow: visible !important;
  background: #fff !important;
  color: #172033 !important;
}

html body #root .client-dossier-footer-panel:has(> div > label > input) > div:has(> label > input) {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  column-gap: 8px !important;
  row-gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
}

html body #root .client-dossier-footer-panel:has(> div > label > input) > div > label {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 5px !important;
  min-width: 0 !important;
  height: 80px !important;
  box-sizing: border-box !important;
  padding: 8px 12px !important;
  border-left: 1px solid #d7e0e9 !important;
  border-bottom: 1px solid #d7e0e9 !important;
  background: #fff !important;
  color: #172033 !important;
}

html body #root .client-dossier-footer-panel:has(> div > label > input) > div > label > span {
  color: #82909e !important;
  -webkit-text-fill-color: #82909e !important;
  font-size: 12.5px !important;
  line-height: 1.2 !important;
}

html body #root .client-dossier-footer-panel:has(> div > label > input) > div > label > input {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 34px !important;
  box-sizing: border-box !important;
  padding: 6px 8px !important;
  border: 1px solid #d7e0e9 !important;
  border-radius: 6px !important;
  background: #fff !important;
  color: #172033 !important;
  -webkit-text-fill-color: #172033 !important;
  opacity: 1 !important;
  font-size: 13px !important;
}

html body #root .client-dossier-footer-panel:has(> div > label > input) > div > .row:last-child {
  grid-column: 1 / -1 !important;
  display: flex !important;
  gap: 8px !important;
  width: 100% !important;
}

html body #root .client-dossier-footer-panel:has(> div > label > input) > div > .row:last-child > .btn {
  min-height: 34px !important;
  color: #172033 !important;
  -webkit-text-fill-color: #172033 !important;
}

html body #root .client-dossier-footer-panel:has(> div > label > input) > div > .row:last-child > .btn.green {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-recent-document) {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 10px 8px !important;
  width: 100% !important;
  max-width: none !important;
  align-content: start !important;
  justify-self: start !important;
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-recent-document) > :first-child {
  grid-column: 1 / -1 !important;
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-recent-document) > .btn {
  grid-column: 1 / -1 !important;
  justify-self: end !important;
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-recent-document) > .client-dossier-recent-document {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  column-gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 90px !important;
  max-height: none !important;
  box-sizing: border-box !important;
  padding: 10px 16px !important;
  border: 0 !important;
  border-left: 1px solid #d7e0e9 !important;
  border-bottom: 1px solid #d7e0e9 !important;
  border-radius: 0 !important;
  background: #fff !important;
  background-image: none !important;
  box-shadow: none !important;
  overflow: hidden !important;
  text-align: left !important;
  cursor: pointer !important;
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-recent-document) > .client-dossier-recent-document > span:first-child > span:first-child {
  display: block !important;
  font-size: 15px !important;
  line-height: 1.2 !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
  white-space: normal !important;
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-recent-document) > .client-dossier-recent-document > span:first-child > span:last-child {
  margin-top: 5px !important;
  font-size: 12.5px !important;
  line-height: 1.2 !important;
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .client-dossier-contact-edit:hover,
html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .client-dossier-contact-edit:focus-visible,
html body #root .client-dossier-footer-panel:has(> .client-dossier-recent-document) > .client-dossier-recent-document:hover,
html body #root .client-dossier-footer-panel:has(> .client-dossier-recent-document) > .client-dossier-recent-document:focus-visible {
  z-index: 2 !important;
  border-left: 3px solid #16a99c !important;
  padding-left: 14px !important;
  box-shadow: 0 12px 26px rgba(15, 23, 42, .15) !important;
  transform: translateY(-3px) !important;
}

html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .client-dossier-contact-edit:focus-visible,
html body #root .client-dossier-footer-panel:has(> .client-dossier-recent-document) > .client-dossier-recent-document:focus-visible {
  outline: 2px solid #16a99c !important;
  outline-offset: 2px !important;
}

@media (max-width: 350px) {
  html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) {
    grid-template-columns: 1fr !important;
  }
  html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .client-dossier-contact-edit {
    grid-column: 1 / -1 !important;
  }
  html body #root .client-dossier-footer-panel:has(> div > label > input) > div:has(> label > input) {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .client-dossier-contact-edit:nth-of-type(n),
  html body #root .client-dossier-footer-panel:has(> .client-dossier-contact-edit) > .btn:last-child {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
}
